savepoints

Savepoint using Hibernate

给你一囗甜甜゛ 提交于 2019-12-06 02:29:54
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. Use this code hibernateConection.setAutocommit(false); Savepoint savepoint = hibernateConection.setSavepoint(); where, hibernateConection is object

How to use savepoints in oracle procedure

会有一股神秘感。 提交于 2019-12-05 23:15:06
I have multiple updates and insert statements in a procedure. Please refer below example: Procedure Example --code Update 1 insert 1 Update 2 Update 3 --Suppose exception occurs Now i want to rollback to before 1st update statement means no update or insert affects. BEGIN Savepoint do_update_1; Update 1; insert 1; Update 2; Update 3; --Suppose exception occurs EXCEPTION WHEN some_exception THEN Rollback To do_update_1; END; ====== edit ========== Working example: http://sqlfiddle.com/#!4/b94a93/1 create table tttt( id int, val int ) / declare x int := 0; begin insert into tttt values( 1,1);

Achieving NHibernate Nested Transactions Behavior

你说的曾经没有我的故事 提交于 2019-11-30 22:44:23
I'm trying to achieve some kind of nested transaction behavior using NHibernate's transaction control and FlushMode options, but things got a little bit confusing after too much reading, so any confirmation about the facts I list below will be very usefull. What I want is to open one big transaction that splits in little transactions. Imagine the following scenario: TX1 opens a TX and inserts a Person's record; TX2 opens a TX and updates this Person's name to P2; TX2 commits; TX3 opens a TX and updates this Person's name to P3; TX3 rollbacks; TX1 commits; I'd like to see NH sending the INSERT

Achieving NHibernate Nested Transactions Behavior

淺唱寂寞╮ 提交于 2019-11-30 17:20:40
问题 I'm trying to achieve some kind of nested transaction behavior using NHibernate's transaction control and FlushMode options, but things got a little bit confusing after too much reading, so any confirmation about the facts I list below will be very usefull. What I want is to open one big transaction that splits in little transactions. Imagine the following scenario: TX1 opens a TX and inserts a Person's record; TX2 opens a TX and updates this Person's name to P2; TX2 commits; TX3 opens a TX