Questions tagged [hibernate-entitymanager]

Hibernate EntityManager implements the programming interfaces and lifecycle rules as defined by the JPA 2.0 specification.

Hibernate EntityManager implements the programming interfaces and lifecycle rules as defined by the JPA 2.0 specification. For more informatio refer the link.

288 questions
1
vote
0 answers

Transient fields change will affect entity manager

My process is as follows: load entity from dao by entity manager change something in fields that those fields is mark as @Transient after finish process, I mean finish a transaction, I see some update statement log from JPA Usually, I think…
1
vote
0 answers

Execute custom query when a connection is fetched from dataSource

My web application runs on Tomcat 7.0 and uses Spring 3.2, Hibernate 4.3 and Oracle Database. The entityManagerFactory is configured as org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean and the transactionManager is…
1
vote
1 answer

Jpa or entity manager deal with list of parameter : List

I have tried : @Query("Select m.id from Cars m where m.id not in :x") List findNotChoosenCars(@Param("x") List CarsId); I get : org.postgresql.util.PSQLException: ERREUR: erreur de syntaxe sur ou près de « ) » Translation: syntax error…
John
  • 185
  • 1
  • 6
  • 21
1
vote
0 answers

How to improve performance of batch inserts using JPA EntityManager?

This is how I am doing bulk inserts using EntityManager in JPA. Batch size is currently set to 50. I cannot call commit for each batch size. Either the whole transaction should be committed, or nothing at all. The method bulkInsert() is being called…
Righto
  • 855
  • 3
  • 11
  • 32
1
vote
2 answers

SQL Server Windows Authentication and Hibernate

Trying to connect, using Hibernate 4.3, to SQL Server with Windows Authentication, i'm getting a: "No Persistence provider for EntityManager named instanceTest" I have loaded the sqljdbc_auth.dll library and im using this…
1
vote
1 answer

Spring Data JPA - Refreshing the entityManager in @PostPersist

I was working on defining a One to Many bidirectional relationship between entities A and B and realized that the entityManager should be refreshed after persisting A for B to be updated with A. This is explained here At the service layer, instead…
1
vote
0 answers

JAX-RS webservice testcase Injection of EntityManager sets NULL object in TestClass

I am beginner with JAX-RS webservice and its testcase. My TestController class is as follows: public class LotTypeMangementServiceTest { private final String LOT_NAME = "lotName"; @Inject private LotTypeManagementService…
1
vote
1 answer

Delete entity while using two instances of EntityManger

I am trying to delete entity but I get this exception: java.lang.IllegalArgumentException: Removing a detached instance I understand that my problem is that I am using two different EntityManger instances. I looked out for a solution but all the…
Sagie
  • 996
  • 3
  • 12
  • 25
1
vote
0 answers

Delete query is not working using hibernate 5.2.1 and also get exception in debug mode

I have two persistence classes Person and Account as below: Person Class package org.proggence.persistence; import static javax.persistence.GenerationType.IDENTITY; import java.sql.Date; import javax.persistence.CascadeType; import…
1
vote
0 answers

Perisistence Exception : No Persistence provider for EntityManager named defaultPersistenceUnit

I am new to PLAY framework. I keep getting this error. I don't seem to find any problem with the code though. Please help me out. conf/META-INF/persistence.xml:
1
vote
1 answer

Different SQL using find and createQuery from Hibernate entity manager

I'm using Hibernate 3.3.0.GA and I noticed some strange behavior, not documented (I think). I noticed that entityManager.find resolve the EAGER relationships of my entity and entityManager.createQuery not. Per example, if I have an…
Dherik
  • 17,757
  • 11
  • 115
  • 164
1
vote
1 answer

Exception in thread "main" javax.persistence.PersistenceException: No Persistence provider for EntityManager named TEST

I work on a project in JPA, I connected it with a MySQL database that contains tables already filled using the GlassFish server, I created a test class to test to display a column of a table With a SELECT query but I still have a persistence…
AmineBena17
  • 23
  • 1
  • 5
1
vote
1 answer

multiple entitymanagers in a transaction

I am writing an application that will move data from one database to another Using JPA EntityManager API. My questions are : 1. Can i use multiple entity managers in a single transaction? 2. Can i read an entity from one database and persist it in…
joshua
  • 4,118
  • 3
  • 40
  • 53
1
vote
1 answer

entityManagerFactory is slow to start

I have a problem that slow down my development in general. The deployment of my webapplication is slow. The main problem come from the creation of te entityManagerFactory which take like 15sec (when the deployment on the server only take 1…
Antoine Grenard
  • 1,712
  • 3
  • 21
  • 41
1
vote
1 answer

Mediation between Hibernate Entity Listeners and netty-socketio

I am working on a small Java project, and here's the basic idea of what I'm trying to achieve: I have a layer over netty-socketio that accepts socket.io requests from the browser, and I use JPA 2.1/hibernate to persist the requested changes to DB.…