*
The moose likes Spring and the fly likes Access hibernate session inside onMessage using ActiveMQ Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Access hibernate session inside onMessage using ActiveMQ" Watch "Access hibernate session inside onMessage using ActiveMQ" New topic
Author

Access hibernate session inside onMessage using ActiveMQ

zabet tyan
Ranch Hand

Joined: Jan 14, 2009
Posts: 32
Hi

Can someone point me to a document/site that could help me figure out how to get hibernate session inside onMessage method of a MessageListener?

When I inject a finder in my messageListener, I always get org.hibernate.SessionException: Session is closed!

Here is what I have so far:



and findAreaByName :



and my entityManager code:





configuration:
zabet tyan
Ranch Hand

Joined: Jan 14, 2009
Posts: 32
Finally after days of beating myself in the head with a hammer I solved the problem!... only if could read more books

anyways here is the solution, wrap the messageHandler in transactionProxy



Now off to the next problem
 
Consider Paul's rocket mass heater.
 
subject: Access hibernate session inside onMessage using ActiveMQ
 
Similar Threads
Hibernate insert fails due to generate key failure
spring 2 with hibernate 3
Queue and session is closed! problem
unsatisfied Dependancy exception
JDBCContext returning TransactionManager as null