close « Transaction « JPA Q&A





1. Hibernate error "database is locked". How do i correctly close session?    stackoverflow.com

In my application I open session, create criteria but dont close it. Then in other method I open session again, update object and receive database is locked on tr.commit(). If I put ...

3. commit closes my session    forum.hibernate.org

Hello everyone. I have some java code and the commit closes automaticly the session. do I do some thing wrong i always give error => connection already closed or how can i make the code better ( just learning java) Thx for helping me Bert Code: Session session = HibernateUtil.getSessionFactory().getCurrentSession(); ...

4. JTA Transactions. Problem when closing the session.    forum.hibernate.org

Hi all, I have jus tried to create my first Hibernate example (simple servlet) using JTA and I cannot get it work.. My question is simply: Do I need to to begin and commit the hibernate Transactions when using JTATransactionFactory? The problem is that, when using the idiom: Code: Session session = factory.openSession(); Transaction tx = null; try { ...

5. demo: adminapp - transaction not closed ???    forum.hibernate.org

Hi, I am new to hibernate and working on my first implementation on an real-world community / techNet website ... someday :) I have taken a look at the demo app provided by Hibernate and have the following question about it: In the class CreateUserAction, the following piece of code occurs: getSession().save(user) So I understand that a session is retrieved with ...

6. Websphere and transactions (closing sessions)    forum.hibernate.org

Session session = null; try { session = SessionFactoryPlant.getSessionFactory().openSession( new RKTInterceptor()); session.saveOrUpdate(case); } catch( HibernateException e ) { LOGGER.debug( "An HibernateException occured during saving, thrown as a PersistException", e ); throw new PersistException( e ); } finally { if (session != null && session.isOpen() ) { ...

7. Session close and Transaction commit    forum.hibernate.org

8. Why the table get locked even the session has closed?    forum.hibernate.org

Regular Joined: Sun Jan 18, 2004 9:43 am Posts: 50 Hi all The table get locked after the program throws an exception. I have tried closing the session and rolling back the transaction but the table sitll gets locked. What I need to do to solve this problem? I am using MS SQL Server 2000 and MS provided JDBC driver. Is ...

9. ThreadLocal and CMT rollback issues - can't close connection    forum.hibernate.org

Newbie Joined: Wed Dec 10, 2003 8:40 pm Posts: 9 Hi there, I am having some issues with CMT rollbacks not working correctly. I am using the Steve Ebersole variation on the ThreadLocal pattern, and stateless session beans calling DAOs for data access. On Weblogic 8.1, sql server 7. I find that when I use a new Session per operation all ...





10. tx.rollback() and session.close() failing    forum.hibernate.org

Author Message rich Post subject: tx.rollback() and session.close() failing Posted: Mon Aug 30, 2004 4:16 pm Beginner Joined: Sat Dec 20, 2003 5:09 pm Posts: 38 Problem I'm using the threadlocal pattern to manage the hibernate session in a stand-alone, command line, XML parser. In testing, I found that my transaction rollback/session close (located in the finally block) is ...

11. Transaction behavious on session.close()    forum.hibernate.org

Hibernate version: 2.1 Hi All, What is the behaviour of a transaction when the session that it was obtained from is closed via a call to Session.close() ? Does this call cascade any other objects that were created by it as a call to Connection.close() does in JDBC with Statments etc? If it does do a cascade clean up of objects ...

12. Session is closed when commit    forum.hibernate.org

13. Optimistic Lock using auto_close_session and CMT    forum.hibernate.org

Hello, I'm having problem with the Automatic JTA and Session binding in Hibernate 3 and the optimistic lock strategy. If I update a row the version number get's incremented only after the transaction commits. The commit occurs on transaction completion, that is after the EJB returns. As we use the DTO patterns, the value of the version attribute is copied before ...

14. Error session is closed while commit transaction    forum.hibernate.org

15. Connection.close() requested while a transaction is in progr    forum.hibernate.org

Could anyone please tell me the reasons behind these hibernate exceptions and possible solution. I am working on a maintenance of a web-based application which has been demonstrating slow performance. On a close look at the logs, the following error messages are seen: [7/8/05 13:17:57:662 CDT] 15771a JDBCException W net.sf.hibernate.util.JDBCExceptionReporter SQL Error: -99999, SQLState: null [7/8/05 13:17:57:665 CDT] 15771a JDBCException E ...

16. can close the database Connection before the JTA transaction    forum.hibernate.org

hi, all can close the database Connection before the JTA transaction commit or rollback? my understanding: if the connection not come from connection pool. i think this must be a issue, but if Connection come from pool, the close method just return it to pool, but due to multithread environment, the connection maybe can be used immediately by another thread, but ...





17. hibernate.transaction.auto_close_session    forum.hibernate.org

i'm not sure why it is happening. in my hibernate.cfg.xml, i had set "hibernate.transaction.auto_close_session" to false. but when i looked at the debug log, i noticed the following: 11:12:04,322 [DEBUG http-8080-Processor24 org.hibernate.event.def.AbstractFlushingEventListener] executing flush 11:12:04,322 [DEBUG http-8080-Processor24 org.hibernate.event.def.AbstractFlushingEventListener] post flush 11:12:04,323 [DEBUG http-8080-Processor24 org.hibernate.jdbc.JDBCContext] before transaction completion 11:12:04,323 [DEBUG http-8080-Processor24 org.hibernate.impl.SessionImpl] before transaction completion 11:12:04,324 [DEBUG http-8080-Processor24 org.hibernate.transaction.JDBCTransaction] committed JDBC Connection ...

19. Result set closed on transaction commit, but inconsistently?    forum.hibernate.org

Author Message porridge Post subject: Result set closed on transaction commit, but inconsistently? Posted: Tue Jun 13, 2006 10:51 am Newbie Joined: Tue Jun 13, 2006 9:51 am Posts: 4 Location: London, UK Hello, Basically, if I do (pseudo-code, working test case below): Code: openSession(); t = beginTransaction(); rs = createSQLQuery.scroll(); while (rs.next()) { // ...

20. Session is closed Automatically when i tx.Commit()    forum.hibernate.org

Im using a hibernate service to create my session factory. No matter where i put this setting it doesnt take effect. Ive put it in hibernate.properties and my hbm.xml. and its always set to enabled. How do i change it to false.. and why is it set to true.. seems like a silly assumption, since most db providers tell you to ...

21. Hibernate2 to Hibernate3, session closed after commit    forum.hibernate.org

Newbie Joined: Wed Feb 14, 2007 10:57 am Posts: 1 Hello, I try to migrate from Hibernate 2 to Hibernate 3.2, and my code now generates an exception. I code this way to avoid handling tx.rollback() in every catch: Code: Transaction tx = null; Session session = null; try{ session = new HibernateUtil().currentSession(); ...

23. Hibernate session closed, without transaction committed    forum.hibernate.org

Hi, I have a question regarding the Hibernate sessions/transactions. I'm familiar how it should be done, but I have a code which doesn't rollbacks the transactions, but closes the session in the finally block. I was wondering if an exception occurs, the session.close will automatically roll back the transaction? The code looks like this: try { currentSession = databaseSession.openSession(); Transaction transaction ...

24. Does rollback(); automatically close the session?    forum.hibernate.org

Hi, I was wondering whether session.getTransaction().rollback(); automatically closes the session in hibernate 3.3.1 GA? I'm trying to close the session after the rollback in a finally block, as is recommended by the documentation, but I get an exception saying that the session is already closed. If I comment out the session.close() statement, the code runs fine, as shown below: session.beginTransaction(); try ...

25. committing/persisting without closing the connection.    forum.hibernate.org

Hello. i'm relative new to JPA/Hibernate and therefore have following problem: I leech files, convert em to csv, and load them into a database. For each leeched file i create a status-object, which holds a list of log-objects. After each step in the process, i create a log-object with some infos and add it to the log-object list within the status-object ...

26. Commit and Rollback closes the Session (3.3.1.GA)    forum.hibernate.org

See Java Persistence with Hibernate 11.1.2. "All the data-access code that calls getCurrentSession() on the global shared SessionFactory gets access to the same current Sessionif its called in the same thread. The unit of work completes when the Transaction is committed (or rolled back). Hibernate also flushes and closes the current Session and its persistence context if you commit or roll ...

27. session closes with commit() - is it a configurable ?    forum.hibernate.org

Hi all ! I'm using Hibernate to update a Database schema and invoke some Stored Procedures. I can see that when I issue commit(), then the Session is closed, as a matter of fact If I issue session.close() afterwards, I'll get an error "Session is closed!". Is it configurable to close() the session with/without commit() ? Here's an example: Code: ...