Skip to content

Tag: hibernate

MySQL: Unknown system variable ‘tx_read_only’

I’m working on a Java Swing-based application+ Hibernate+Mysql+Spring. When I test CRUD operations, I don’t have problems with read, but in insert statements system shows the message: I have the last version of MySQl Hibernate 4 Java annotations Can you tell me which is the problem to solve now? A…

Spring fails to inject entity manager factory

I writing tests for my DAO classes using JPA, with Hibernate as JPA provider, and Spring 3.2. I am not able to inject the entity manager correctly, I get a NullPointerException when trying to access it. My GenericDAO implementation looks like this: The class of the test looks like this: My root-context.xml is…

Hibernate faster EntityManagerFactory creation

In my desktop application new databases get opened quite often. I use Hibernate/JPA as an ORM. The problem is, creating the EntityManagerFactory is quite slow, taking about 5-6 Seconds on a fast machine. I know that the EntityManagerFactory is supposed to be heavyweight but this is just too slow for a desktop…