-->
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.  [ 2 posts ] 
Author Message
 Post subject: Hibernate process with open transactions on SQL Server
PostPosted: Mon Nov 27, 2006 12:19 pm 
Newbie

Joined: Mon Nov 27, 2006 12:08 pm
Posts: 1
Hibernate version:
3.1 using MyEclipse Hibernate integration (to create SessionFactory's, HBM's, etc)

Code between sessionFactory.openSession() and session.close():
Code:
      List <BMWIndices>newList = new ArrayList<BMWIndices>();
      Session session = null;
      
      try {
         
         session = BankRatesSessionFactory.getSession();
         
         for (Object o : session.getNamedQuery("GetBMWIndicesByTerm")
                                    .setParameter(0, term).list())
            newList.add((BMWIndices)o);
         
         session.clear();
         
      } // try
      catch (HibernateException he) {
         he.printStackTrace();
         throw he;
      } // catch
      finally {
         try {
            BankRatesSessionFactory.closeSession();
         } // try
         catch (Exception exp) {
            exp.printStackTrace();
         } // catch
      } // finally
      
      return newList;


Name and version of the database you are using:
SQL Server 2005


We are experiencing an issue with the way hibernate is setup in our application (if it's a setup issue, really not sure). Any time a query is run using the above code sample, there remains an open hibernate process on SQL Server with 1 open transaction in a sleeping status. It is never cleaned up, we have to manually kill it because it seems to have locks on certain tables/fields such that our nightly jobs are delayed waiting for those locks to be removed. The last T-SQL command given by SQL Server for this process is "set implicit_transactions on".

Our application spans 3 databases, and as each one is queried, a process shows up in SQL Server for each of the databases that seem to persist indefinitely. We really need a solution that will clear those up so that any data loads/updates we do at night can process through without waiting for those processes to be killed due to the locks.

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 27, 2006 12:49 pm 
Expert
Expert

Joined: Tue Jul 11, 2006 10:21 am
Posts: 457
Location: Columbus, Ohio
Are you sure it's not the connection pooling mechanism you are using that is maintaining the open jdbc connection?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.