1. Song Tom
  2. PowerBuilder
  3. Tuesday, 9 July 2019 06:18 AM UTC

Dear Appeon:

 

           thanks your support always, we found a database connection issue, it is a dynamic call the begin tran in the application, when transaction autocommit set to true, it is run normally in the OLE DB, but fail in the SNC connection, if is fail we hard to control the transaction, as I understand, when transaction set to autocommit transaction control would be invalid, but this code real run well in old application for many years in OLE DB, I found an suggestion to add Mars connecton =false below , then we added in the database connection, but sometime , it can cause block other users, so we confuse about it, can help us understand that and find a better solution on that?

 

https://community.appeon.com/index.php/qna/q-a/native-client-for-sql-server-snc

Song Tom Accepted Answer Pending Moderation
  1. Monday, 15 July 2019 09:42 AM UTC
  2. PowerBuilder
  3. # 1

you can check previous Appeon suggestion on these type of issue

https://community.appeon.com/index.php/qna/q-a/native-client-for-sql-server-snc?limitstart=0#reply-5089

Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Monday, 15 July 2019 09:38 AM UTC
  2. PowerBuilder
  3. # 2

Don't know about MARS, but maybe this link might be helpful: 

https://docs.microsoft.com/en-us/sql/relational-databases/native-client/features/using-multiple-active-result-sets-mars?view=sql-server-2017

It mentions transactions and batches.

Good Luck!

 

Comment
There are no comments made yet.
Song Tom Accepted Answer Pending Moderation
  1. Monday, 15 July 2019 09:20 AM UTC
  2. PowerBuilder
  3. # 3

Dear Appeon:

 

     but the same code with begin tran commit and rollback can work success on OLE DB connection, it can only get error under SNC like "A transaction that was started in a MARS batch is still active at the end of the batch. The transaction is rolled back.", only add (mars connection =false) can work. we searched the Microsoft document the Mars connection option, it saids that Mars connection default false in SQL server native client, we donot know why it set to true in SNC connection which need us disable by manual, seems mars connection =false also led to data lock something, as we cannot see any explain detail in PowerBuilder technical document, so can help us explain on this, seems lot of old application use this with autocommit set to true, when migrate to SNC, whether there is better solution?

Comment
There are no comments made yet.
David Peace (Powersoft) Accepted Answer Pending Moderation
  1. Tuesday, 9 July 2019 08:23 AM UTC
  2. PowerBuilder
  3. # 4

Hi

I do not think I fully understand. You are using autocommit=true but want to manually control the transactions. Surely these two are mutually exclusive. To manually control transactions you will need autocommit=false

Perhaps a bit more information will help us understand your issue.

Thanks

 David

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.