1. Hibernate :session and begin transaction in the constructor of the abstractDao coderanch.comHi All, I wanted to know your thoughts on this one. We are using a genericDao. All Dao's used as part of the application will inherit this genericDao. I was trying to modularize as much code as possible in this generic dao. In the constructor of the genericDao I am planning to keep the fetch session and begin transaction calls. ------------ ... |
2. Hibernate transaction begin stuck coderanch.comDear all In my web application , I write a hibernate transaction filter as below public class HibernateSessionRequestFilter implements Filter { public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { Transaction tx = null; try { logger.warn(HibernateServiceImpl.getCurrentSession()); tx = HibernateServiceImpl.getCurrentSession().getTransaction(); if (!(tx != null && tx.isActive())) { tx.begin(); } chain.doFilter(request, response); if (tx != null && tx.isActive()) { ... |
3. HELP!!! Hibernate can't begin transaction. forum.hibernate.org |
4. Transaction Begin stuck forum.hibernate.orgDear all In my web application , I write a hibernate transaction filter as below Code: public class HibernateSessionRequestFilter implements Filter { public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { Transaction tx = null; ... |
5. Begin transaction on a closed connection forum.hibernate.orgI am using cdo, on top of teneo on top of hibernate on top of postgresql. After a tcp connection close (hibernating my laptop) I ran into an exception which seemingly means that hibernate tries to begin a transaction on a closed db connection (see at bottom). I was looking for the issue in the bugzilla, there was one similar bug ... |
6. Why need I have to begin transaction using "getCurrentS forum.hibernate.orgNeed help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version: 3.1.3 |
7. 'SQLOLEDB' was unable to begin a distributed transaction forum.hibernate.orgI am refering to two tables both in different databases in my stored procedure. hibernate.connection.url is pointing to the database which has the stored procedure. When I execute the sp directly in the database it is executing without any error, but when I execute it through my application it throws following error 19:37:13,109 WARN [JDBCExceptionReporter] SQL Error: 7391, SQLState: S1000 19:37:13,109 ... |
8. Where do I begin transaction and commit forum.hibernate.orgYou should begin the transaction before your "unit of work" starts. Typically this is outside of the DAO. Consider this example unit of work... you want to delete a user, delete their preferences and write a log entry to the dabase. These must all happen within the same transaction but would probably use separate DAOs for the different operations. Hence, start ... |
9. should i use begin and commit for each hibernate call ? forum.hibernate.orgi have no problem executing hsql like below , but after my app run for few hours, i get exception at the bottom. is it because i didnt use "begintransaction" and commit in my query method ? my example query:::::: Criteria crit = sess.createCriteria(TheObject.class,"table_name") .addOrder(bSortOrder ? Order.asc(sortColumnId): Order.desc(sortColumnId)) .setFirstResult(nFirst) .setMaxResults(nPageSize); random exception after app run for many hours:::: ARNING: Template for ... |
10. Repeated calls to Transaction.begin() forum.hibernate.orgpublic class HibernateSessionManagerImpl implements HibernateSessionManager, ThreadCleanupListener { private final Session session; private Transaction transaction; public HibernateSessionManagerImpl(HibernateSessionSource source) { session = source.create(); transaction = session.beginTransaction(); } ... |
11. Error when begin transaction forum.hibernate.orgI save object with the following code: public boolean saveAndUpdate(TblCustomerInfo customerInfo) { Session session=getHibernateTemplate().getSessionFactory().openSession(); try{ Transaction tx=session.beginTransaction(); session.saveOrUpdate(customerInfo); tx.commit(); if(tx!=null){ try{ tx.rollback(); } catch(HibernateException ex){ ex.printStackTrace(); } } } catch(HibernateException ex){ ex.printStackTrace(); } return true; } But it give the error: org.hibernate.TransactionException: Transaction not successfully started at org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:149) at com.callcenter.dao.impl.CustomerManagerDAOImpl.saveAndUpdate(CustomerManagerDAOImpl.java:73) at com.callcenter.service.impl.CustomerManagerImpl.saveAndUpdate(CustomerManagerImpl.java:38) at com.callcenter.web.pages.EditCustomer.onSuccess(EditCustomer.java:26) at com.callcenter.web.pages.EditCustomer.dispatchComponentEvent(EditCustomer.java) at org.apache.tapestry.internal.structure.ComponentPageElementImpl.dispatchEvent(ComponentPageElementImpl.java:843) ............ and i ... |