I have a question regarding interactions between multiple sessions and a single transaction. First, let me give you the use case. I have a scenario where code runs under a new session/transaction. Part way through the logic flow, I need to open a new session/sessionfactory to the same database but with a different user, yet still have it participate under the same transaction. I'm building connection strings programmatically. Is this possible? If so, should I be creating a new session or an entire new session factory? How do I tell the new session or factory to use the ambient transaction?
Thanks, and please ask for clarification if I did not describe it well enough!
|