Page 1 of 1
Wrong logging statements order, missing unprepare
Posted: 10.05.2017, 08:54
by DPStano
Transaction Commit is logged before Execute Statement and Unprepare Statement is not logged at all and there should be transaction handle/id for each statements ... its really weird when i have 10 connections and can't identify which transaction run which query
Re: Wrong logging statements order, missing unprepare
Posted: 11.05.2017, 20:32
by marsupilami
Hello DPStano,
what should I say? Zeos doesn't need transaction handles since there is only one active transaction per connection. Logging is done in the DBC drivers. Have a look in your driver if you want to modify the logging behaviour. Watch out for calls like DriverManager.LogMessage or just LogMessage. If you need help doing this, let me know.
With best regards,
Jan
Re: Wrong logging statements order, missing unprepare
Posted: 16.05.2017, 07:17
by DPStano
i forgot DB is firebird with 10+ active connections so i have 10 active transactions with 100 query/min, error queries are logged but is't a bit problematic to find out transactions when some db deadlock/error happen or even filter queries by connection when multiple similar queries are logged at same time
Re: Wrong logging statements order, missing unprepare
Posted: 16.05.2017, 07:24
by DPStano
when it comes unprepare statement
prepare statement is loged as
https://github.com/svn2github/ZeosLib/b ... .pas#L2243
but when you look at unprepare its not loged at all
https://github.com/svn2github/ZeosLib/b ... .pas#L2248
Re: Wrong logging statements order, missing unprepare
Posted: 16.05.2017, 07:28
by DPStano
Re: Wrong logging statements order, missing unprepare
Posted: 17.05.2017, 19:06
by marsupilami
Hello DPStano,
hmm - I understand your problem. Honestly I really would like to get rid of that part of the code and make use of the Firebird Autocommit again. One could move the call "inherited ExecutePrepared;" to a position before the commit. But that would make your transaction not commit in case there happens something bad with the logging...
What do you think?
With best regards,
Jan