Wrong logging statements order, missing unprepare

The forum for ZeosLib 7.2 Report problems. Ask for help, post proposals for the new version and Zeoslib 7.2 features here. This is a forum that will be edited once the 7.2.x version goes into RC/stable!!

My personal intention for 7.2 is to speed up the internals as optimal a possible for all IDE's. Hope you can help?! Have fun with testing 7.2
Post Reply
DPStano
Junior Boarder
Junior Boarder
Posts: 39
Joined: 16.05.2016, 09:21

Wrong logging statements order, missing unprepare

Post 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
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1956
Joined: 17.01.2011, 14:17

Re: Wrong logging statements order, missing unprepare

Post 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
DPStano
Junior Boarder
Junior Boarder
Posts: 39
Joined: 16.05.2016, 09:21

Re: Wrong logging statements order, missing unprepare

Post 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
DPStano
Junior Boarder
Junior Boarder
Posts: 39
Joined: 16.05.2016, 09:21

Re: Wrong logging statements order, missing unprepare

Post 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
DPStano
Junior Boarder
Junior Boarder
Posts: 39
Joined: 16.05.2016, 09:21

Re: Wrong logging statements order, missing unprepare

Post by DPStano »

commit logged before execute prepared statement

commit is logged at
https://github.com/svn2github/ZeosLib/b ... t.pas#L367

but execute prepared is logged two lines after
https://github.com/svn2github/ZeosLib/b ... t.pas#L369
https://github.com/svn2github/ZeosLib/b ... .pas#L2222
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1956
Joined: 17.01.2011, 14:17

Re: Wrong logging statements order, missing unprepare

Post 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
Post Reply