1. Hibernate. Nested transactions. Lock coderanch.comI'm working with MySQL and I have 2 transaction, one is within the other. External:private void saveData(Service service, BigDecimal price) { Account account = service.getAccount(); FinancialOperation financialOperation = FinancialOperation.getInstance(account, price); ServiceExpense serviceExpense = new ServiceExpense( account, price, service.getTariffPlan(), new DateTime(), service); TransactionStatus transactionStatus = transactionManager.beginTransaction(); try { financialManager.doFinancialOperation(financialOperation);//here the inner transaction will be involved serviceExpenseDetailsService.saveObject(serviceExpense); transactionManager.commit(transactionStatus);//here we wait 100 seconds and ... |
2. Nested Transactions forum.hibernate.orgAre they supported by Hibernate? The questions is, if i have code liked this: Transaction tx = null; try { tx = hibernateSession.beginTransaction(); Transaction nestedTx = hibernateSession.beginTransaction(); persistentObject.changeValue("newValue"); nestedTx.commit(); .... more business logic .... tx.commit(); } catch (Exception ex) { if (tx != null) { tx.rollback(); log.error(e, e); } } Will the tx.rollback() roll the nestedTx back as well? |
3. Nested transaction and Session forum.hibernate.orgHi all Supposed I have 2 EJB, A and B. Each starts its own transaction by declaring "RequiresNew". Then, in EJBA, we retreive an object and examine its value. Afterwards we make a call to EJBB, which retrieves the same object and alter its value. When EJBB returns, the new value will be committed to the DB. What happens to the ... |
4. Nested transactions, how? forum.hibernate.orgI may miss understand you issue but is usualy best to avoid nested transactions. You can serialise your Tx operations, eg, pCode session.open insert a category; session.close session.open for(1 to 10) { insert a child category. } session.close You could move the second session/Tx inside the loop if you wish to not have all child insert operations under the one transaction. ... |
5. nested transaction forum.hibernate.org |
6. Does Hibernate support nested transactions forum.hibernate.orgHi, I did not find out wheter hibernate supports nested transactions. We have a global transaction where we want to nest other transactions. In detail we have a form object, that has multiple pages, whereas pages have multiple blocks. So our idea is to have a global transaction around the form object. If choosing a page within the form we want ... |
7. Nested transactions possible? forum.hibernate.orgI need to use nested transactions. Is that possible? Suppose I have something like this: Code: public class User { public void deductMoney() { Transaction tx = session.beginTransaction(); setMoney(getMoney() - 10)); tx.commit() } public void buyStuff() { Transaction tx ... |
8. nested transactions? forum.hibernate.orgHi, I need to get data from two databases. Therefore I structure my program as follows: Code: public Object getDB1and2Data() throws HibernateException { Session sess = null; Transaction tran = null; try { sess = ... |
9. Nested transactions not supported exception forum.hibernate.orgHi, i deeply appreciate anyone who can provide any solution to this problem which i have been trying to solve for the past 5 days but to no avail. I am facing this show-stopper in my project now. Any experts here can help me? I am using Sun One App Server 7, Oracle 9i and Hibernate 3 for my project. Below ... |
10. nested transactions forum.hibernate.orgWe have the following code: Session session = currentSession(); Transaction tx1 = session.beginTransaction(); TrackableLink newTL = new TrackableLink(); newTL.setUrl( "innen "+new java.util.Date().toString()); newTL.setMailingID( 1); session.save( newTL); Transaction tx2 = session.beginTransaction(); newTL = new TrackableLink(); newTL.setUrl( "auen "+new java.util.Date().toString()); newTL.setMailingID( 1); session.save( newTL); tx1.commit(); tx2.rollback(); closeSession(); After execution we have two new rows in the database. When when commiting tx2 after a ... |
11. Does Hibernate support nested transactions? forum.hibernate.org |
12. Question abt Nested transaction in Hibernate 3.1. forum.hibernate.orgSession session; Transaction tx; //Global variable void method1(){ tx = session.beginTransaction(); method2(); //Do something session.saveOrUpdate(myobj1); tx.commit(); <------- I'm getting error here } void method2(){ tx = session.beginTransaction(); //Do something session.saveOrUpdate(myobj2); tx.commit(); ... |
13. Not able to do Nested Transactions? forum.hibernate.orgI am reading conflicting things about using Hibernate 3 and nested transactions in relation to the default transaction manager. If I have setup a datasource in JBoss that uses the default transaction manager (and it appears to default to the org.hibernate.transaction.JTATransactionFactory) nested transactions do not work for me. This is what I see: Quote: org.hibernate.exception.GenericJDBCException: Cannot open connection If I remove ... |
14. Hibernate3 - Nested Transactions forum.hibernate.orgNewbie Joined: Sun Jul 02, 2006 8:29 am Posts: 1 Hello, I have implemented an application using Hibernate 2.1.6. The application was working correctly when I decided to upgrade to Hibernate 3.1.2. The problem is that in some parts of my code I have nested transations, which is a bean that have an insert method and in that insert method I ... |
15. Nested transaction forum.hibernate.orgI need to use nested transaction in my application, what kind of setting in hibernate.cfg.xml is good for this purpose? Is there any potential problem I need to be awared of? I am using |
16. Suport of nested JDBC transactions in hibernate3.2 is absent forum.hibernate.orgHello people I have a problem with the nested trnasactions with the 3.0.2.cr5: Code: Session session = factory.openSession(); Transaction tx = null; try { tx = session.beginTransaction(); // Do some work session.load(...); session.persist(...); Transaction nested = null; ... |
17. Hibernate - nested transactions or parallel ones forum.hibernate.org |
18. Nested transactions / suspending transactions. forum.hibernate.orgHibernate version: 3.3.0 CR1 Name and version of the database you are using: MS SQL Server 2005 I have a web application that consists of various servlets and JSP pages, with Hibernate at the back-end. I am using the "Open Session In View" model, implemented as a servlet filter that opens the transaction and commits/rolls back at the end. This works ... |
19. Newbie Q:any issue nesting jdbc and hibernate transactions forum.hibernate.orgI want to use a outer hibernate transaction and an inner jdbc transaction as below. I am new to Hibernate and i want to know, will nesting of transactions pose any issue even if it works. Transaction transaction = session.beginTransaction(); SessionFactory sessionFactory = configuration.buildSessionFactory(); Session session = sessionFactory.openSession(new LoggerInterceptor()); Transaction transaction = null; Connection con =null; try{ transaction = session.beginTransaction(); session.save(obj1); ... |