Skip to content
Advertisement

Tag: hibernate

JPA PessimisticLockScope.NORMAL and locking “relationships”

I am studying JPA Documentation and encountered the following lines: Entity relationships for which the locked entity contains the foreign key will also be locked, but not the state of the referenced entities (unless those entities are explicitly locked). Element collections and relationships for which the entity does not contain the foreign key (such as relationships that are mapped to

JPA @Version field doesn’t get incremented

I’m new to JPA and Hibernate and I have a problem with optimistic locking. I have a class which has an @Version annotated field. When I update the Entity represented by this class, the version counter does not increase. Here is my code: The class: and here is the main method: and here is what the console says: Can somebody

First level cache not working with JPA and Hibernate

I an new to use hibernate caching (first level, 2nd level and query cache). My project is configured using Spring MVC and JPA. I am testing first level cache using JUnit test case below. And my entity class is defined as : This should execute native query once in case first level cache is by default enabled. But I am

How to fix Hibernate LazyInitializationException: failed to lazily initialize a collection of roles, could not initialize proxy – no Session

In the custom AuthenticationProvider from my spring project, I am trying read the list of authorities of the logged user, but I am facing the following error: Reading other topics from here in StackOverflow, I understand this happens due the way this type of atribute is handled by the framework, but i can’t figure out any solution for my case.

Hibernate C3P0 settings performance issues

Since we have added C3P0 connection pooling to the application performance became slower. It is Oracle 10g database, Hibernate 3.1.3 and C3P0 0.9.0.4. WebSphere application server. I am very new to this things, so I don’t understand everything. Is this configuration could slow down the app performance? What should I change if so? Answer c3p0-0.9.0.x is very, very old. Please

Advertisement