3

I have my Web Application running on WebSphere 6.0 and also there are some Quartz Scheduler Tasks. If I do the lookup like that in hibernate.cfg.xml:

<property name="jta.UserTransaction">java:comp/UserTransaction</property>

It works fine with my Web Application, but any threads initiated by Quartz Timers fail to access the DB using that lookup string. But if I use

<property name="jta.UserTransaction">jta/usertransaction</property>

Then it is the opposite. I will get quartz timers working but I can't do the lookup inside my Web Application.

Is there any way to make them both work with same hibernate configuration?

EDT: here is my quartz.properties file. By the way Quartz Version is 1.5.2.

org.quartz.scheduler.instanceName = TestScheduler
org.quartz.scheduler.instanceId = one


org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount =  5
org.quartz.threadPool.threadPriority = 4

org.quartz.jobStore.misfireThreshold = 5000

org.quartz.jobStore.class = org.quartz.simpl.RAMJobStore
Pavel Shchegolevatykh
  • 2,568
  • 5
  • 29
  • 32

2 Answers2

0

I don't know if this is relevant to you but I recently had a similar problem. My issue was remote and local access and altering my design a bit and adding the interface names to my @Local & @Remote annotations worked for me.

onesixtyfourth
  • 744
  • 9
  • 30
0

I think you miss the transaction management in your quartz.properties. Something like this:

org.quartz.scheduler.userTransactionURL=jta/usertransaction
org.quartz.scheduler.wrapJobExecutionInUserTransaction=true

The idea is to tell Quartz to wrap the job execution in a transaction and where to get it.

Julien
  • 1,087
  • 7
  • 15