[hibernate-dev] Hibernate Integrator Causes Flush When Using JPA Transactions Around Queries
Wolfgang Wedemeyer
wolfgang at crypteron.com
Sun Sep 6 18:09:08 EDT 2015
Gail - thanks for the clarification. My post on the forum is now over a week old and bumped down to the second page of threads with no responses. I would appreciate any of the very gifted Hibernate developers visiting https://forum.hibernate.org/viewtopic.php?f=1&t=1041360 <https://forum.hibernate.org/viewtopic.php?f=1&t=1041360> and helping decide if the software is working as intended and if there is some sort of workaround or perhaps future development that would enable my use case.
Thanks,
Wolfgang
> On Aug 27, 2015, at 11:03 , Gail Badner <gbadner at redhat.com> wrote:
>
> This mailing list is for hibernate developers to discuss Hibernate development. Please use the user forum for help: https://forum.hibernate.org/ <https://forum.hibernate.org/>.
>
>
>
> On Wed, Aug 26, 2015 at 9:38 PM, Wolfgang Wedemeyer <wolfgang at crypteron.com <mailto:wolfgang at crypteron.com>> wrote:
> Greetings Hibernate Developers!
>
> I'm working on an Integrator for Hibernate (background on Integrators: https://docs.jboss.org/hibernate/orm/4.3/manual/en-US/html/ch14.html#objectstate-decl-security <https://docs.jboss.org/hibernate/orm/4.3/manual/en-US/html/ch14.html#objectstate-decl-security> <https://docs.jboss.org/hibernate/orm/4.3/manual/en-US/html/ch14.html#objectstate-decl-security <https://docs.jboss.org/hibernate/orm/4.3/manual/en-US/html/ch14.html#objectstate-decl-security>>) that by using listeners is supposed to take my data from how it's stored in the DB and convert it into a different form for processing at runtime. This works great when saving the data using .persist() however there's an odd behavior involving transactions. It appears that since the Integrator does a modification on the entity in question it gets marked as "dirty" and upon committing this odd transaction, it bypasses my event listeners and writes the value back in the wrong format! How can I write my Integrator to behave correctly in this case so that I can "undo" the conversion that has happened with my entities at runtime and not flush the wrong value out?
>
> I have further details including quickstart tutorial code that uncovered the issue for me posted on Stack Overflow: http://stackoverflow.com/questions/31671824/hibernate-integrator-causes-flush-when-using-jpa-transactions-around-queries <http://stackoverflow.com/questions/31671824/hibernate-integrator-causes-flush-when-using-jpa-transactions-around-queries> <http://stackoverflow.com/questions/31671824/hibernate-integrator-causes-flush-when-using-jpa-transactions-around-queries <http://stackoverflow.com/questions/31671824/hibernate-integrator-causes-flush-when-using-jpa-transactions-around-queries>>
> but have yet to receive any responses. Feel free to reply there or send me a response back to this email if you can be of assistance.
>
> Thanks,
> Wolfgang
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org <mailto:hibernate-dev at lists.jboss.org>
> https://lists.jboss.org/mailman/listinfo/hibernate-dev <https://lists.jboss.org/mailman/listinfo/hibernate-dev>
>
More information about the hibernate-dev
mailing list