-->
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.  [ 4 posts ] 
Author Message
 Post subject: Can i open another session in same transaction??
PostPosted: Sun Dec 23, 2007 10:24 pm 
Newbie

Joined: Sun Dec 23, 2007 10:11 pm
Posts: 3
Hi All,

I am trying to Open One more session inside the transaction and creating Transaction for that session .after Query i am closing the session and after some i am commiting main transaction and closing the main session.the problem i am facinng is second session coneections are growing in database..Any one help me how to handle this scenario


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 23, 2007 10:53 pm 
Regular
Regular

Joined: Sat Nov 25, 2006 11:37 am
Posts: 72
Can you tell us a little bit more of what you are trying to do and the environment. In an typical J2SE environment not using JTA your transaction is coupled to the session. This is actually where you get it from in the first place. Therefore opening a 2nd session is starting a 2nd independent transaction. In a J2EE and/or JTA environment it is different as it allows you to run a distributed transaction, that is multiple sessions can connect to the same transaction. But this typically only makes sense if you connect to different resources.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 24, 2007 2:48 pm 
Newbie

Joined: Sun Dec 23, 2007 10:11 pm
Posts: 3
i am getting two diffrent sessions.after gettting the first session .i am starting first transaction.in this time i need a data from some other database.i am opening a session for that database with diffrent hibernet confiuration file .i am opening the another transaction.after transaction completes i am closing that session.after some task i am commiting main transaction and closing the session.it is j2se applecation only.But the problem i am facing is .first session are closing in the databse with out any problem.but second sessions are not closing in the database.when my applecation is running it is keep on incresing the sessions in the databse for the second session.after some time in database connections become full.my applecation is stoping with jdbc connection Error. i am using hibernet 3.2 version.Can you please help me ??


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 24, 2007 2:53 pm 
Newbie

Joined: Sun Dec 23, 2007 10:11 pm
Posts: 3
i am getting two diffrent sessions.after gettting the first session .i am starting first transaction.in this time i need a data from some other database.i am opening a session for that database with diffrent hibernet confiuration file .i am opening the another transaction.after transaction completes i am closing that session.after some task i am commiting main transaction and closing the session.it is j2se applecation only.But the problem i am facing is .first session are closing in the databse with out any problem.but second sessions are not closing in the database.when my applecation is running it is keep on incresing the sessions in the databse for the second session.after some time in database connections become full.my applecation is stoping with jdbc connection Error. i am using hibernet 3.2 version.Can you please help me ??


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

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.