Questions tagged [entitymanager]

The EntityManager is the representation of a PersistenceContext, allowing a user to manipulate data pulled from a database.

1802 questions
0
votes
1 answer

hibernate.hbm2ddl.auto its not working

I created an EJB project and I use entity manager (config: data source and persitence.xml) how can I added the hibernate.hbm2ddl.auto property? I added this property to persitence.xml file but its not working
0
votes
3 answers

How to instance doctrine entity manager in a symfony2 class

I am new with Symfony 2 and Doctrine. I have created a new class on my symfony project, which is located in: project_folder/src/Libraries/Validarcontenido/Validarcontenido.php I need to get the Doctrine Entity Manager instance in this class. I…
viher
  • 114
  • 1
  • 9
0
votes
1 answer

Does application exception roll the transaction back?

I have a stateless bean class TestBean: package samples; import javax.ejb.*; import javax.persistence.*; @Stateless public class TestBean { @PersistenceContext EntityManager em; …
romsky
  • 864
  • 1
  • 8
  • 11
0
votes
1 answer

EntityManager.persist() works, but EntityManager.merge() does not

We are using EclipseLink 2.5.2 and WildFly 9.0.0. Here is a method that gets called a certain number of times every hour (specified by an EJB timer). For my testing purposes, I've changed it to fire off every minute, and in my specific configuration…
Evan LaHurd
  • 977
  • 2
  • 14
  • 27
0
votes
0 answers

JPA/Hibernate: EntityManager.close() and IllegalStateException?

I have a logging service within a JEE environment which uses TransactionManagementType.BEAN because the logging should be independent from JTA transactions, so I have to deal with transactions by myself. Currently this logging service looks like…
Bevor
  • 8,396
  • 15
  • 77
  • 141
0
votes
0 answers

Getting No Persistence provider for EntityManager named myPersistentUnit , even if the persistent.xml is under '/WEB-INF/classes/META-INF/'

Getting No Persistence provider for EntityManager named myPersistentUnit , even if the 'persistent.xml' is under '/WEB-INF/classes/META-INF/'. My war is deployed on the Tomcat server. Here is my persistent.xml
Ash Ash
  • 443
  • 4
  • 7
  • 15
0
votes
3 answers

Java + Oracle + EntityManager

My problem is that I have a query with EntityManager like: Query query = em.createQuery("select nombre from OTP_OPERACION_DETALLE"); and Java throws this exception: error e: An exception occurred while creating a query in EntityManager: Exception…
jorgeregidor
  • 208
  • 2
  • 13
0
votes
2 answers

Fetching entity records for UserAdmin form

I'm fairly new to Symfony and trying to get to grips with the platform. I have managed to install Sonata CMF, FOS User Bundle, and the Sonata User Bundle. I have got to the point where I can create users, and other entities through the out of the…
diggersworld
  • 12,770
  • 24
  • 84
  • 119
0
votes
0 answers

JPA injection : EntityManager NULL exception

I have the following error using JPA with Eclipse : EntityManager : NULLpointerException. The code of the class is : @ManagedBean(name="inputHStockManager") @RequestScoped public class InputHStockManager { …
Soji
  • 177
  • 1
  • 5
  • 17
0
votes
1 answer

When the data is flushed but not committed is it possible to get Optimistic Lock Exception

I recently learned that when we do an explicit flush the data is moved to DB but its isolated and only visible to current transaction and hidden from other threads and transactions. So my question is if I have a multi-threaded application First…
Nick Div
  • 5,338
  • 12
  • 65
  • 127
0
votes
1 answer

Why is Hibernate's EntityManager.persist() not throwing an exception?

I cannot figure out why I am not seeing an exception for trying to insert 20 characters into a 10byte oracle table field... I confirmed the bad (too large string) is in the object, and the database does show varchar2(10). Here is the code (extra…
Kairan
  • 5,342
  • 27
  • 65
  • 104
0
votes
1 answer

How can a persistenceContext link with multiple EntityManager

Recently I have gone through PRO JPA2 book and find that "A single persistence context can be link with multiple EntityManager instance." I have searched for the same but could not found satisfactory answer. Can anybody elaborate this with example?
Sai prateek
  • 11,842
  • 9
  • 51
  • 66
0
votes
1 answer

vaadin date format not formatting properly when data loaded with lazyquerycontainer and jpa

Hi I am using lazyquerycontainer integrated with jpa. As the entity manager loads the data some fields are in bigdecimal format but I want to show in date format. In the filtertable I have defined a decorator also but the format it is displaying is…
0
votes
1 answer

WebSphere Liberty Profile DataSource and CDI

I have setup my Development environment with a WebSphere Liberty Profile 8.5.5.6. I configured a DataSource in my server.xml
0
votes
1 answer

entity manager implicit transaction commit

Let's take into consideration the following code snippet: public class EmployeeServiceImpl implements EmployeeService { @PersistenceContext(unitName="EmployeeService") EntityManager em; public void assignEmployeeToProject(int empId,…
GionJh
  • 2,742
  • 2
  • 29
  • 68