These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: How to pass information within Hibernate Session
PostPosted: Thu Nov 06, 2008 1:59 pm 
Newbie

Joined: Thu Nov 06, 2008 9:53 am
Posts: 1
I am using Hibernate 3.0 with JTA scoped session context (using getCurrentSession). I am storing a userId and transactionId in a as thread local variables. Using my own ConnectionProvider, I am pulling these variables from thread local and calling a stored procedure on the connection to set the database session identifier, before giving the connection to Hibernate.

My issue is that when hibernate flushes the changes to the database, it is using a seperate thread from the thread pool, and therefore it doesn't contain the same thread local variables as when the session was created.

I somehow need a way to access transactionId and user from any thread in the transaction, and also be able to use these values to call the stored procedure on the JDBC connection before handing it off to Hibernate.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.