Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Access hibernate session inside onMessage using ActiveMQ  RSS feed

 
zabet tyan
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!