Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
5
Erster Beitrag:
vor 2 Monaten, 3 Wochen
Letzter Beitrag:
vor 2 Monaten, 2 Wochen
Beteiligte Autoren:
Ola, SolutionJ-Reg, DarrenF

[WD21] How to check whether hTransactionStart has already been called?

Startbeitrag von Ola am 28.07.2017 11:26

Hi all,

hTransactionStart cannot be called nested.
Is there any way to check whether a transaction is already being logged, before starting a new one, other than using own flagging?

Best regards
Ola

Antworten:

Hi Ola,

Maybe you could test for error # 70031?



Error cases
•Nesting transactions: The transactions cannot be nested (which means that HTransactionStart
cannot be called in a transaction). In this case, the error 70031 occurs.
•A fatal error is displayed in the following cases: •A transaction is started on all the connections
while there is at least one connection in transaction.
•A transaction is started on a connection while a transaction was already started on all the connections.
•A transaction is started on all the connections while there is at least one connection whose isolation
mode is not "Read Uncommitted".


von DarrenF - am 28.07.2017 12:59
Thanks Darren,

I'll try if I can test for error 70031 without causing any noise to the user. If that cannot be done silently then there is also the possibility to test for the existence of the transaction log file.

Best regards
Ola

von Ola - am 28.07.2017 13:43
Hi,

Just do a little When Exception In block with just an htransactionstart statement. Then you can check the error code or even just ignore it.

Rgds
Reg

von SolutionJ-Reg - am 28.07.2017 15:00
Hi Reg,

That seems like a neat solution. Thank you.

Best regards
Ola

von Ola - am 29.07.2017 14:25
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.