In a Desktop Application using Castle ActiveRecord
I open a SessionScope and keep alive for the application lifetime, I dispose this at the end of the application.
When I need to do "something" I do it, and if I need transactional operations, I create TransactionsScope(s) an nested transactions as needed, after a transaction is ended correctly i flushes the session and continue to keep alive the SessionScope.
Is this aproach correct? or I need to open a SessionScope at the start of a bl process and closes it at the end? if yes, why?.
I uses LazyLoad and a process can call another process as needed, at the same time a single process can runs alone.
-update- the correct aproach is to open a sessionscope at form level, but as the ar sessionscope is created at a stack way, i can't have more than 1 sessionscope at the same level, i only have a sessionscope into another one, someone knows howto resolve this problem?
Resolved: implementing IThreadScopeInfo managing a stack collection. i'm starting to think castle ar is deprecated.
thank you.