activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reynald Borer <reynald.bo...@gmail.com>
Subject Re: hibernate session in jms listner
Date Sun, 31 Oct 2010 18:26:48 GMT
Hi,

As far as I know, there is no such thing in ActiveMQ as its not its purpose to handle Hibernate
session and related things.

But in Spring for example you can use a TransactionTemplate [1] in order to wrap your business
code in a transaction (which will assure you that you have a session open). Even better in
my opinion, from your message listener you call business methods on another bean whose methods
are annotated with a transaction definition.

Cheers,
Reynald

[1]: http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/transaction/support/TransactionTemplate.html


On Oct 31, 2010, at 11:13 , fachhoch wrote:

> 
> I am getting lazy load exception when I use my hibernate entity inside a
> message listener, please advice me if there are any abstract Message
> listeners  which   opens session puts   it into thread local     ?
> 
> -- 
> View this message in context: http://activemq.2283324.n4.nabble.com/hibernate-session-in-jms-listner-tp3020983p3020983.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message