#1 2017-02-16 07:49:13

edwinsn
Member
Registered: 2010-07-02
Posts: 1,215

"cannot rollback - no transaction is active" - followup

This is a follow-up for this original post: (https://synopse.info/forum/viewtopic.php?id=3682).

The mORMot server log and madExcept log (client-side0 are located here: (https://gist.github.com/edwinyzh/053ea7 … ff4257dc2c)

Additional info
===

- Client-side: At the time of the original post, the program in question was using client-side transactions, however by now all client-side transactions have already been removed and have been converted to batch-mode instead.
- Server-side: I have applied checking for "is in transaction" before calling

rollback

or

TransactionBegin

.

Note:
===
In the original post, ab said:

I guess there is something wrong with your SQL statement executed in first line, during the Batch sequence.

.
I don't quite understand that, since we cannot compose SQL statements ourselves in batch-mode...

References
===
Discussion about the same SQLite error in the Xaramin forum: (https://forums.xamarin.com/discussion/1 … t-rollback). This error seems to be really mystery...

Last edited by edwinsn (2017-02-16 07:53:24)


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#2 2017-02-19 06:44:55

edwinsn
Member
Registered: 2010-07-02
Posts: 1,215

Re: "cannot rollback - no transaction is active" - followup

@ab,

Do you have any other advises at this moment smile


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#3 2017-02-19 07:17:13

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,231
Website

Re: "cannot rollback - no transaction is active" - followup

Don't use SQL but batch crud operations.
Or use a server side service with raw SQL execution.

Offline

#4 2017-02-19 08:25:30

edwinsn
Member
Registered: 2010-07-02
Posts: 1,215

Re: "cannot rollback - no transaction is active" - followup

ab wrote:

Don't use SQL but batch crud operations.
Or use a server side service with raw SQL execution.

This is what I'm doing now - no client-side CURD/SQL nor clident-side transactions.

Is is possible that the instability of the network, such as when transmitting through VPN, would cause such problems?


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#5 2017-02-19 09:01:26

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,231
Website

Re: "cannot rollback - no transaction is active" - followup

My guess is that it may be due from concurrent client connections, and client waiting for each other.
Some kind of unexpected race condition at network level...

Offline

#6 2017-02-19 11:21:21

edwinsn
Member
Registered: 2010-07-02
Posts: 1,215

Re: "cannot rollback - no transaction is active" - followup

@ab,

Does the moRMot framework itself has a mechanism for handling network broken situations? For example, what will happen if the network is broken during a batch-mode update process? Thanks.


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#7 2017-02-19 15:28:12

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,231
Website

Re: "cannot rollback - no transaction is active" - followup

The whole batch content is set at once, so if it reaches the server, it will be executed.
The fact that it is a single sent/answer request makes it much less sensitive to any network error.
It there is a timeout/network issue, it is easy to check on the client side that the information has been added/updated, after re-connection.

Offline

Board footer

Powered by FluxBB