2011-07-06 46 views
3

的问题是使用im保存或在临时基地休眠更新...保存点使用Hibernate

现在,当我终于开火更新,将其存储在数据库永久否则回滚吧..

如何使用Hibernate基础使得存储点是春天。

HibernateTemplate hibernateTemplateObj = getHibernateTemplate(); 

hibernateTemplateObj.saveOrUpdateAll(userList); 

现在我想在连接添加保存点之前保存或更新。

任何帮助将appriciate ..

谢谢你在adv。

回答

2

使用此代码

hibernateConection.setAutocommit(false); 

Savepoint savepoint = hibernateConection.setSavepoint(); 

其中,hibernateConection是第三方库的对象liquibase.ext.hibernate.database.HibernateConnection