1. Steve Mason
  2. PowerServer Mobile
  3. Friday, 10 August 2018

I am using PB 2017 R2 and SQL Server 2017.  The following test code works when running on a desktop.  When running on a mobile device (iPad) I get error "The COMMIT TRANSACTION request has no corresponding BEGIN TRANSACTION."

---------------------------------
string ls_sql

ls_sql = 'begin transaction'
execute immediate :ls_sql using sqlca;
if sqlca.SQLCode <> 0 then
    messagebox('Begin Error', sqlca.sqlerrtext)
end if

update test1 set fmt = 3 where id = 1 using sqlca;
if sqlca.SQLCode <> 0 then
    messagebox('Update Error', sqlca.sqlerrtext)
end if

ls_sql = 'commit transaction'
execute immediate :ls_sql using sqlca;
if sqlca.SQLCode <> 0 then
    messagebox('Commit Error', sqlca.sqlerrtext)
end if

Appeon Support Team Accepted Answer Pending Moderation
0
Votes
Undo

Hi Steve,

I did not reproduce this issue on our end. Do you had set sqlca.autocommit to true? please change it to false to solve the issue.

If there is still the issue, lease open a support ticket here so we can resolve it: https://www.appeon.com/standardsupport/search

And please provide information below to us for more study, thanks.
1 A simple PB case.
2 SQL to create table & data.
3 Application profile in Toolkit.
4 Please refer to below article to provide the Appeon server log and Appeon error log to us too.
http://support.appeon.com/index.php?/Knowledgebase/Article/View/50/0/what-you-can-provide-to-us-for-further-debugging-when-you-run-into-the-appeon-server-related-issues

Ragards,
ZhaoKai

Comment
There are no comments made yet.
  1. Monday, 13 August 2018
  2. PowerServer Mobile
  3. # 1
Steve Mason Accepted Answer Pending Moderation
0
Votes
Undo

Chris,

An article I read in PB Developer Journal years ago recommended that Autocommit be set to true and that the application do its own begin, commit and rollbacks so that you don't have active transactions possibly for long periods of time when no updates are done. 

Steve

Comment
There are no comments made yet.
  1. Friday, 10 August 2018
  2. PowerServer Mobile
  3. # 2
Chris Pollach Accepted Answer Pending Moderation
0
Votes
Undo

Hi Steve;

   That would be expected as PowerServer is now managing the DB connection. The Connect command would have already started a BEGIN TRAN on the PS side. So issuing your own BT did not get handled by PS's DB handler, thus the COMMIT TRAN now confuses PS's DB handler & connection pooling.

   Even in PB, this type of DML coding is not advised as PB's DB interfaces handle transaction management. For example, a Connect will force PB to issue a BT. A PB commit will issue an END TRAN + BEGIN TRAN to be automatically generated behind the scenes. 

   Is there any specific reason that you think the your App needs to take this type of low level DB control in it's own hands?

Reagrds ... Chris

Comment
There are no comments made yet.
  1. Friday, 10 August 2018
  2. PowerServer Mobile
  3. # 3
  • Page :
  • 1


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