persist « Glassfish « JPA Q&A





1. Is it possible to use hibernate as Glassfish's persistence provider?    stackoverflow.com

Is it possible to use hibernate as Glassfish's persistence provider and if so HOW?

2. How to persist the same JPA Entity at multiple databases (distributed system)?    stackoverflow.com

(How) is it possible to persist a JPA Entity at the databases of multiple servers without copying everything to DTOs? We have a distributed system. Some applications do have DBs for caching ...

3. How to "parameterize" JPA database instance in persistence.xml?    stackoverflow.com

I have a Java web application leveraging JPA. The database instance is specified in the persistence.xml file using the jta-data-source tag. I would like to deploy a second copy of the ...

4. JPA Glassfish Database Update Issue    stackoverflow.com

I have an application deployed on Glassfish v3.0.1 which reads events from a table in my database. Once ready it marks them as processed. I am getting a strange error I ...

5. Fixing "Could not resolve a persistence unit..." errors when PU is specified, found    stackoverflow.com

I'm running Glassfish 3.1-SNAPSHOT as of today (2010-11-12). I'm using the embedded EJBContainer. On the classpath, as reported by the EJBContainer, I have a META-INF/persistence.xml. This file defines two persistence units: one ...

6. persistence.xml for ejb deployed in glassfish    stackoverflow.com

folks, i am trying to deploy a ear with a ejb in the ear root. the ejb has a persistence.xml file where the tag has to be a jar file in ...

7. Java Persistence (JPA) heap Issue    stackoverflow.com

I have a simple EAR application running on Glassfish using JPA. It reads records from my Oracle DB table and processes them. Once processed they are marked as so in the ...

8. EJB persistence issue with OSGI    stackoverflow.com

I am beginning to use EJB for a project (the eCOM Project actually). I have some beans that I need to save to a database, like a Status bean. The code ...

9. Glassfish/Hibernate save without calling save explicitely    stackoverflow.com

I am using Glassfish 2 and container managed persistence with Hibernate 3.2 as persistence provider. I have some finder method in my business logic, which manipulates some persistent entities, which have ...





10. Java, Glassfish JPA: NoClassDefFoundError: javax/persistence/spi/PersistenceUnitInfo (JDK6/7 only)    stackoverflow.com

I'm fairly new to Java EE6 and Glassfish3. I was trying to build my own application when I got this error.

NoClassDefFoundError: javax/persistence/spi/PersistenceUnitInfo
Assuming it was an ignorance issue I ...

11. JPA2 and Glassfish: persistence unit not found    coderanch.com

Not with JEE6, in fact my EJB works perfectly when I don't use JPA. But it's the JAP persistence.xml file that must have an error... the problem is it doesn't show any information about it, not any log. And I don't even know for sure if my properties prefix is the correct one for the default Glassfish JPA implementation. Thank you ...

13. JPA persist Locale type with TopLink Essentials?    java.net

For a non JDBC type like Local the specification dictates that the value should be serialized to the database. Although TopLink Essentials has the functionality to output the value as a String it isn't yet exposed though the Java Persistence API. Alternatively your suggestion of updating the getter/setter to convert the value will work as well. --Gordon

14. EJB3 & JPA: make change to entity after calling em.persist    java.net

Yes, this is the expected behavour. Persist is registering the entity with the context so that the entity is now managed. The state of all managed entities get put into the database when the context is flushed or commited. Merge on the other hand will take a detached entity and return a managed instance with any changes merged into it.

15. Persistence Context in JPA    java.net

That's my question, In the case I have different PC among locally caller and called SFSB. But the propagation requires the same PC, right? In other words, If a stateful session bean with an extended persistence context calls a stateful session bean with a different extended persistence context in the same transaction, an IllegalStateException would be thrown.





17. JPA - why persist and merge, why not a sigle save    java.net

With a merge( ) operation, the ORM has to do a SELECT first to identify if a row exists, and then perform an INSERT or an UPDATE to save the data. (Atleast this is what happens with Hibernate as the underlying implementation) So, if the application knows that it is creating a new instance, it can call the persist( ) directly ...

19. Persistence / JPA / TopLink: lost updates    java.net

I have an application running under GlassFish v2UR1, which occasionally deletes a row in a database table. Before this deletion, but in the same transaction, the row is updated for reasons of bookkeeping. And this update is in certain circumstances lost in the sense that TopLink does not even try to execute it (I turned logging for persistence to finest and ...

20. Hibernate persistence integration in Glassfish    java.net

Persa Zaloshnja wrote: > Hi once again, > > Here I got some logs to clear the problem state I am having: > > [#|2008-02-04T10:52:12.143+0100|SEVERE|sun-comms-appserver1.0|javax.enterprise.system.container.sip|_ThreadID=16;_ThreadName=SipContainer-serversWorkerThread-5060-8;javax.persistence.PersistenceException: > No Persistence provider for EntityManager named hibernatetest: The > following providers: > oracle.toplink.essentials.PersistenceProvider > oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider > Returned null to createEntityManagerFactory. > ;_RequestID=849cdb23-926d-4ca8-be61-e65bf89fe83a;|Exception allocating > servlet |#] > [#|2008-02-04T10:52:12.146+0100|WARNING|sun-comms-appserver1.0|javax.enterprise.system.stream.err|_ThreadID=16;_ThreadName=SipContainer-serversWorkerThread-5060-8;_RequestID=849cdb23-926d-4ca8-be61-e65bf89fe83a;|javax.persistence.PersistenceException: > No Persistence provider for EntityManager named ...

21. Glassfish + JPA + TOPLINK + (EJB/Web) + more than 1 Persistence Unit    java.net

- Toplink jars must be packaged in the war(if a web application) or jar because if Toplink has been initialized, it doesn't reinitialize and desn't find the persistence.xml - you cannot use two persistence units because when you try to open the second, Toplinks finds itself initialized and it doesn't find the second p.u. And this happens also in a standard ...

23. JPA: (toplink) can I share a persistence.xml among differnt modules?    java.net

Here is the case: I built one project for persistence only, contains all entity classes and of course persistence.xml file and dbschema. I also have another two project which use this entity project, one is a web app, the other is a java se app. if I run java se app seperately, everything is ok. But when my web app uses ...

24. Exception while invoking class org.glassfish.persistence.jpa.JPADeployer pr    java.net

[#|2009-06-22T19:43:22.673+0100|SEVERE|glassfish|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=11;_ThreadName=Thread-1;|Exception while invoking class org.glassfish.persistence.jpa.JPADeployer prepare method java.lang.RuntimeException: More than one deployer is trying to access the final class loader during prepare phase, use --force=true to force deployment at org.glassfish.deployment.common.DeploymentContextImpl.getFinalClassLoader(DeploymentContextImpl.java:137) at org.glassfish.persistence.jpa.JPADeployer$ProviderContainerContractInfoImpl.(JPADeployer.java:165) at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:121) at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:579) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:244) at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:296) at com.sun.enterprise.v3.server.ApplicationLoaderService.postConstruct(ApplicationLoaderService.java:144) at com.sun.hk2.component.AbstractWombImpl.inject(AbstractWombImpl.java:170) at com.sun.hk2.component.ConstructorWomb$1.run(ConstructorWomb.java:90) at java.security.AccessController.doPrivileged(Native Method) at com.sun.hk2.component.ConstructorWomb.initialize(ConstructorWomb.java:87) at com.sun.hk2.component.AbstractWombImpl.get(AbstractWombImpl.java:77) at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:58) at com.sun.hk2.component.LazyInhabitant.get(LazyInhabitant.java:107) at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:60) at com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:218) ...

25. GlassFish v2.1 and Hibernate Persistence    java.net

Hi m8s... i have done everything that had been written in this forum and in other forums... But still could not achieve my goal... How can we use hibernate as persistence provider in glassfish v2.1... i also tried to use glassfish v3.0 prelude but could not find how to deploy ejb jar files... it only has war file deployment tab... there ...

26. Exception while invoking class org.glassfish.persistence.jpa.JPADeployer    java.net

GRAVE: Exception while invoking class org.glassfish.persistence.jpa.JPADeployer prepare method java.lang.ClassCastException at java.lang.Class.cast(Class.java:2990) at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:149) at org.glassfish.persistence.jpa.PersistenceUnitLoader.(PersistenceUnitLoader.java:96) at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:121) at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:644) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:296) at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:183) at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:272) at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:305) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320) at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1176) at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(CommandRunnerImpl.java:83) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235) at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1224) at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:365) at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:204) at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166) at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:100) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245) at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791) at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693) at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954) at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170) at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88) ...

27. glassfish not deploying with hibernate as JPA persistence provider    java.net

Hi, I'm trying to use hibernate the same way i used JPA in my last project so i went and configured my ConectionPool and i can connect to my schema. I wondered if i could skip the hibernate.cfg.xml that would be great, so I also fixed my persistence.xml to work with Hibernate provider but as soon as i, in my EJB ...