on 2015 Jul 20 9:48 AM
When using MobiLink 16 with ASE 15.5 or 15.7, what are the rules for preventing ASE from incorrectly auto-committing database changes made by MobiLink scripts that both (a) execute SQL INSERT, UPDATE and DELETE statements directly and (b) call ASE stored procedures to execute those statements?
In particular, how should the ODBC AutoCommit option, ASE SET CHAINED statement, and ASE sp_procxmode calls be used, or not used?
EVEN MORE IMPORTANT... How can one tell if something is wrong? Running WITH AutoCommit is like NOT wearing seatbelts, you really don't know anything is amiss until you hit something.
No results found for "set chained" mobilink site:sap.com Your search - "sp_procxmode" mobilink site:sap.com - did not match any documents. Your search - "procxmode" mobilink site:sap.com - did not match any documents. 4 irrelevant hits for "autocommit" "mobilink" "ase" site:sap.com
I. 2015-07-07 15:53:18. <1> (,u1) System event on synchronization connection: save tran it1 I. 2015-07-07 15:53:18. <1> (,u1) Translated SQL: save tran it1 E. 2015-07-07 15:53:18. <1> (,u1) [-10002] Consolidated database server or ODBC error: ODBC: [Sybase][ODBC Driver][Adaptive Server Enterprise]Attempt to issue 'SAVE TRANsaction' when there is no active transaction. (ODBC State = ZZZZZ, Native error code = 628)
I. 2015-07-09 19:20:10. SQL Anywhere MobiLink Server Version 16.0.0.2052 ... I. 2015-07-09 19:20:10. <main> System event on the notifier stage connection: SELECT @@spid I. 2015-07-09 19:20:10. <main> Translated SQL: SELECT @@spid I. 2015-07-09 19:20:10. <main> Locking/blocking detector connection with connection ID 'SPID 26' has been established I. 2015-07-09 19:20:10. <main> Notifier stage connection with connection ID 'SPID 30' has been established I. 2015-07-09 19:20:10. <main> ODBC isolation set to: Read Committed I. 2015-07-09 19:20:10. <main> ODBC isolation set to: Read Committed W. 2015-07-09 19:20:10. <main> [10050] ODBC: [Sybase][ODBC Driver]AutoCommit option has changed to true. All pending statements on this transaction (if any) are committed. (ODBC State = 01000, Native error code = 32024)
C:\\Program Files\\SQL Anywhere 16\\MobiLink\\Setup\\syncase.sql exec sp_procxmode 'ml_model_drop_unused_schema', 'unchained' exec sp_procxmode 'ml_model_drop', 'unchained' exec sp_procxmode 'ml_[EVERYTHING ELSE]', 'anymode'
C:\\Program Files\\SQL Anywhere 12\\MobiLink\\Setup\\syncase.sql exec sp_procxmode 'ml_[EVERYTHING]', 'anymode'
1> /------------------------------------------------------------------------------ 2> * ML Install Script generated 2015-05-13 12:16:34 for Adaptive Server Enterprise 3> * (Consolidated) by MobiLink 12 Plug-in 4> -----------------------------------------------------------------------------*/ 5> 6> COMMIT 7> SET chained off 8> SET quoted_identifier on
[ end ]
In an old email, I found the following description for ASE commit behavior:
#4 is used for MobiLink events (except begin_connection_autocommit) so that MobiLink can control the transactions. The begin_connection_autocommit event was added for ASE in case one needs to do unchained statements, such as DDL to create a temporary table, when a sync connection is created. For all other events, transaction mode is CHAINED, and any called stored procedures should be defined as "chained" or "anymode" by sp_procxmode.
FYI, the ASE OBDC driver sets CHAINED ON when the MobiLink server turns off autocommit.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's not spelled out explicitly, but there is a caution to not do explicit or implicit transaction management, ruling out unchained transaction mode (since it implicitly commits each DML command).
I added a DCX comment to hopefully get the ASE specifics in the MobiLink documentation.
I guess those users aware of "auto-commit" as such are not always aware that there are both server-side ("chained") vs. client-side auto-commit features, and that it takes both cited options set accordingly to get the desired behaviour... - so I highly second Breck's suggestion to add that to the docs.
User | Count |
---|---|
68 | |
11 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.