Consider a transaction-per-view model where with an IHttpModule
i open a transaction using a standard ISession
.
Now, i have a page where i want to do some batch operations. Since IStatelessSession
is preferred for batch operations:
ISession
and IStatelessSession
open at the same time? Is it safe?ITransaction
?ISession
and its associated ITransaction
and then open the IStatelessSession
and a new ITransaction
for it?any ideas are welcome
I recommend not starting a transaction for every HTTP request. Instead start and commit a transaction on the page when you have changes to commit. This also improves exception handling because you can catch the exception on the page instead of at the end of the request.