I'm having difficulty with transactions and new threads which throw exceptions relating to class not found for Hibernate's HqlToken so I'm wondering if I'm missing something with transactions and new threads (timers/synchronization objects against transactions).
I currently have the following scenario:
ServiceA - @Transactional
ServiceB - @Transactional
ServiceA is called by an Session Bean and inherits a weblogic transaction. A synchronization object is registered to this transaction. When the transaction COMMITS, ServiceB is called to do its work.
ServiceB creates a JDK Timer with a spring managed TimerTask.
Now the problem I'm having seems to be with ServiceB creating a new Transaction that does not seem to inherit properties for Hibernate classes? (My understanding of this isn't too deep). When the Transaction for ServiceA commits, the synchronization object registered to it kicks off a new thread which kicks off SerivceB. And when The timer is created in ServiceB it seems to be missing these hibernate related properties.
The timer/timerTask works fine if i call ServiceB directly from ServiceA (therefore serviceB inherits the transaction from serviceA and hence when the Timer is created in serviceB it has the properties or what not to kick off the hibernate job (doing a select statement against the DB)).
Am i missing something obvious here?