[hibernate-dev] Keeping context in the scope of a transaction

Steve Ebersole steve at hibernate.org
Thu Apr 30 07:59:59 EDT 2015


Hard to say exactly without knowing the exact nature of the data you keep,
but couldn't you keep the same principle as before and keep this on your
return from getTransactionDriverControl (the *Inflow contract, Andrea I
thought we had decided to rename that interface as well?)?

On Thu, Apr 30, 2015 at 4:02 AM, andrea boriero <dreborier at gmail.com> wrote:

> Hi Gunnar,
>
>  at the moment I cannot figure out any problem or anything you are missing,
> the solution seems good :)
>
>
>
>
>
> On 30 April 2015 at 09:08, Gunnar Morling <gunnar at hibernate.org> wrote:
>
> > Steve, Andrea,
> >
> > For OGM we need to store certain data in the scope of a transaction;
> > specifically this is the list of applied "grid dialect operations", so we
> > can present these to the user upon failures (and thus "rollbacks") on
> > non-transactional backends.
> >
> > Until now we used a custom org.hibernate.Transaction impl for keeping
> this
> > data. I am now looking into using the new TransactionCoordinator approach
> > instead. Is it a save route to initialise the required context upon first
> > invocation of MyTransactionCoordinator#getTransactionDriverControl() and
> > clear it via TransactionObserver#afterCompletion()?
> >
> > It works fine for me in our tests, but I'd like to make sure I am not
> > missing anything :)
> >
> > Thanks,
> >
> > --Gunnar
> > _______________________________________________
> > hibernate-dev mailing list
> > hibernate-dev at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/hibernate-dev
> >
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev
>


More information about the hibernate-dev mailing list