Savepoint using Hibernate
Asked Answered
Z

1

3

The issue is i m using save or update in hibernate on temporary base...

now when i finally fire update it will store it in DB permanently otherwise rollback it..

how to make save point using hibernate base is spring.

like

HibernateTemplate hibernateTemplateObj = getHibernateTemplate();

hibernateTemplateObj.saveOrUpdateAll(userList);

now i would like to add savepoint in connection before save or update.

Any help would be appriciate..

Thanks in adv.

Zaller answered 6/7, 2011 at 10:13 Comment(0)
B
2

Use this code

hibernateConection.setAutocommit(false);

Savepoint savepoint = hibernateConection.setSavepoint(); 

where, hibernateConection is object of third party library liquibase.ext.hibernate.database.HibernateConnection

Barbwire answered 16/5, 2012 at 6:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.