1. Steve Mason
  2. PowerServer Mobile (Obsolete)
  3. Friday, 10 August 2018 00:58 AM UTC

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
  1. Monday, 13 August 2018 01:03 AM UTC
  2. PowerServer Mobile (Obsolete)
  3. # 1

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.
Steve Mason Accepted Answer Pending Moderation
  1. Friday, 10 August 2018 18:54 PM UTC
  2. PowerServer Mobile (Obsolete)
  3. # 2

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.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 10 August 2018 01:38 AM UTC
  2. PowerServer Mobile (Obsolete)
  3. # 3

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.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.