Replies: 5 comments 3 replies
-
I don't think there is anything like that. Your best option is to handle following events:
for all 3 types of queries using this interceptor If you will have other cases uncovered by those - we can look into fixing it. |
Beta Was this translation helpful? Give feedback.
-
I think I've found the solution. There is a IExecuteScope GetScope() on DataProvider. I provide my own ExecuteScope, and cleanup here in its dispose function.. Do I understand it correctly? |
Beta Was this translation helpful? Give feedback.
-
Seems like it worked for me. Just want to confirm: it was retrieved at the beginning of a query, and got disposed after the query is done, if the scope is not null of course.
Get Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
From: MaceWindu ***@***.***>
Sent: Friday, December 20, 2024 6:40:01 PM
To: linq2db/linq2db ***@***.***>
Cc: szguoxz ***@***.***>; Author ***@***.***>
Subject: Re: [linq2db/linq2db] Help with QueryCleanup (Discussion #4747)
Technically it was added to workaround issues with providers, that use current culture instead of invariant culture when converting parameters to strings, but if it works for you - you can use it too
—
Reply to this email directly, view it on GitHub<#4747 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AEHJXC7MQA7VR6634W47NE32GPXYDAVCNFSM6AAAAABT63ITPGVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNRSG42DGOA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Just to be sure, it is always retrieved and always got disposed! Not depending on any other conditions
Get Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
From: Calvin Guo ***@***.***>
Sent: Friday, December 20, 2024 9:57:50 PM
To: linq2db/linq2db ***@***.***>
Subject: Re: [linq2db/linq2db] Help with QueryCleanup (Discussion #4747)
Seems like it worked for me. Just want to confirm: it was retrieved at the beginning of a query, and got disposed after the query is done, if the scope is not null of course.
Get Outlook for iOS<https://aka.ms/o0ukef>
________________________________
From: MaceWindu ***@***.***>
Sent: Friday, December 20, 2024 6:40:01 PM
To: linq2db/linq2db ***@***.***>
Cc: szguoxz ***@***.***>; Author ***@***.***>
Subject: Re: [linq2db/linq2db] Help with QueryCleanup (Discussion #4747)
Technically it was added to workaround issues with providers, that use current culture instead of invariant culture when converting parameters to strings, but if it works for you - you can use it too
—
Reply to this email directly, view it on GitHub<#4747 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AEHJXC7MQA7VR6634W47NE32GPXYDAVCNFSM6AAAAABT63ITPGVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNRSG42DGOA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Nice!
Get Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
From: MaceWindu ***@***.***>
Sent: Saturday, December 21, 2024 10:23:38 PM
To: linq2db/linq2db ***@***.***>
Cc: szguoxz ***@***.***>; Author ***@***.***>
Subject: Re: [linq2db/linq2db] Help with QueryCleanup (Discussion #4747)
Yes
—
Reply to this email directly, view it on GitHub<#4747 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AEHJXC5KPE6UIJKWIR7LSFD2GV2WVAVCNFSM6AAAAABT63ITPGVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNRTG43TEOI>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
My scenario:
In ValueConverter, I have borrowed some memory frmo Memorypool.
I need to return those memory on Query Completion.
I couldn't find a place that is always run when a Query is done.
I currently use OnCommandDispose to do the clean up job, but it's the wrong place, because if one of the ValueConverter throw an exception, the command won't even be created.
Any suggestions?
Beta Was this translation helpful? Give feedback.
All reactions