|
#1
|
||||
|
||||
|
Stored Procedure issue
We have a visual basic application that uses the iSeries for it's database. We are in the process of converting the database interfaces to stored procedures from individual SQL statements.
This is the scenario that is causing my problem: Stored procedure A performs an insert using CS isolation level Additional processing occurs within the VB application. Stored procedure B performs a rollback. The previously inserted record remains in the database and doesn't get rolled back. What settings or program options would I have to use so that a separate stored procedure can commit changes of another stored procedure that use the same connection? Additional info: Connection method OLEDB, V5r4, Stored procedure compiled with *none for isolation level. Isolation level is handled within the SP for each statement. Also, this application didn't use commitment control previously, they decided to enhance it with the SP conversion. Thanks in advance, Rick |
|
#2
|
|||
|
|||
|
Quote:
The most obvious consideration here is that you don't have a complete "transaction" at any one point. There is that little bit of VB code in between the SQL calls. Is the VB code massaging the data or going back to windows for user input? Either way, why can't the first SQL script be run AFTER the little bit of VB code within a single SQL script? |
|
#3
|
||||
|
||||
|
Quote:
|
|
#4
|
|||
|
|||
|
I am interested in this concept.
All my stored procedures so far are complete units of work; they do their own commits and roll backs. IBM provides support for a 'DUW' (distributed unit of work) so that commit can work across platforms, but I am not sure whether you have to buy anything--I know DB2 connect is supposed to support this. Basic CLI commits when you issue a commit command. But first, are you sure that your connection method (JDBC, ODBC, OLEDB) data source is configured for commit control? If autocommit is turned on, it may be committing between invocations. |
|
#5
|
||||
|
||||
|
Quote:
Thanks everyone for your input. Rick |
![]() |
| Thread Tools | |
| Display Modes | |
|
|