Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Mysterious Cache Problem

Carlos Conti
6 years ago Oct 27, 2015 4:02pm
Carlos Conti
6 years ago Oct 27, 2015 4:03pm
Petrus Viljoen
6 years ago Oct 28, 2015 8:20am
Carlos Conti
6 years ago Oct 28, 2015 10:38am
Petrus Viljoen
6 years ago Oct 28, 2015 11:46am
Carlos Conti
6 years ago Oct 28, 2015 2:42pm
Petrus Viljoen
6 years ago Oct 28, 2015 3:12pm

.... which is responsible for creating the Sessions. So basically we have one transaction per session

You should have one(or more) transaction(s) per request rather than a transaction per session BTW.

If I finish all transactions properly, should there RESOURCE_LOCAL play a role? Transactions shouldn't6 remain active, in that case it would totally make sense, but it is not the case.
 

If you finish all your transactions properly ( even in case of unexpected runtime exceptions ) this should not play a role. JTA just simplify things ( mostly ),

Then I suggest you enable SQL logging in Hibernate ( if posible ) and/or jdbc (  profileSQL=true  connction property if I'm not mistaken ), to confirm if the query is excecuted on Mysql or not . If you see the see jdbc queries, the issue is probably somewhere with the transactions/isolation level , if not it is an issue with Hibernate caching ( but as noted before I don't use hibernate much ).

 

Carlos Conti
6 years ago Oct 28, 2015 4:20pm
Carlos Conti
6 years ago Feb 18, 2016 8:37am

Hi Petrus,

the problem is solved but honestly don't know exactly why. The solution was to introduce c3p0 as connection pool in my application, and everything was solved magically. So an unsufficient connection management problema might have caused the error, not allowing transactions to finish somehow, and not allowing other transactions to read fresh data.

Hope not to see this problem ever again. Was exhausting.

Regards,

Carlos.