Hi,
we have a SQLJ procedure which inserts and commits after every 300 rows
with autocommit set as false.
requirement is that if there is an error in any record, only that insert should be rollbacked keeping earlier record inserts and once 300 record inserts are over, it should commit.
We created savepoint before every record insert.since it does not allow us to create a savepoint even with diff. name when there is one already existing (error savepoint already exists and nested savepoints not supported), we released savepoint (from record #2 onwards) and recreated before insert start.
If we get an error during insert, we rollback to the latest savepoint created before insert and fire a commit after batch commit frequency is reached (Eg. 300) .
Expected result is all records except the erroroneous one should get inserted.
But to our surprise none of the records were inserted.
Logic of our program is such that,
there is a controller/Main SQLJ which calls processing SQLJ for every record and we tried savepoint creation, release and rollback in the processing SQLJ.
Version : for testing, DB2 V7.1 on sun solaris unix box.
requirement on DB2 V7.1 on mainframe os/390
Can anyone please help in this regard.