Questions tagged [persistence-unit]

Persistence Unit is a logical grouping of user defined persistable classes (entity classes, embeddable classes and mapped superclasses) with related settings.

80 questions
0
votes
1 answer

Using different datasources for persistence units in Spring

Ok, I' new to this. What I want to do is say "these classes are persisted over here (database a), and these classes over there (database b)". I think I'm supposed to define the classes explicitly under different persistence-unit groups, which can…
end-user
  • 2,845
  • 6
  • 30
  • 56
0
votes
1 answer

My persistence Unit is pinning to the fjords, when used for a remote connection

While i does manage to connect to my database through the "Services" netbeans tab, my application persistent unit seems to not be working... It just seems to go in an endless "Wait some more, maybe we'll connect you later..." cycle. Question 1: Why…
0
votes
0 answers

Define Entity Class at Runtime Instead Of Only In Persistence.xml

I see that this question has been asked before, but I haven't seen any answered in a number of years. The answers from previous years which I was able to find were not adequate. Is there a way to load/set/define entity classes for a persistence unit…
Baba
  • 79
  • 1
  • 12
0
votes
1 answer

EJB persistence not working

I have a example EJB persistence with EJB module run on Jboss 5GA , JDK 6 . Default package have 3 file : Book.java : import java.io.Serializable; import javax.persistence.Column; import javax.persistence.Entity; import…
jack ma
  • 21
  • 1
  • 4
0
votes
1 answer

EclipseLink, use of Criteria api with Composite Persistence Unit (possible or not)

I need to manage 2 databases in my application. For it, i have developed a sample application using EclipseLink Composite Persistence Unit feature. However during my tests i notice a strange behaviour: - basics jpa operations (persist, merge,…
dan73
  • 1
  • 1
0
votes
1 answer

How to use EJB 3 with persistence unit on a JBoss AS?

I have a JBoss AS, and on this server there is a standalone.xml file where there several properties, there are my datasources too, so how combine the datasources in the standalone.xml file with a persistence unit that I want to add to an EJB ?
0
votes
1 answer

Entity unknown in EAR with persistence unit in another jar

I'have an EAR with a WAR module, some EJB modules and some JARS, for instance: EAR - moduleEjb.jar - moduleWeb.war -lib - entity.jar - resource.jar I want to use persistence units from the resource.jar so the ejb modules are…
Daniele Licitra
  • 1,520
  • 21
  • 45
0
votes
1 answer

How can I manage to use 2 persistense units and make my app to recognize which to use?

I hava a JavaEE/ EJB3 application in which I'll need to connect diferent databases. It's on JBOSS 5.10GA. After I tried to deploy it I got the following error: 09:04:57,921 ERROR [AbstractKernelController] Error installing to Real:…
0
votes
0 answers

JPA-Eclipse link, use Composite Persistence Units without

I need to use two difrent databases, with relation in entities between them. I want to have all entities in on project and use Composite Persistence Unit to manage which entity will be storen on which database. Is this possible? I found only example…
simo
  • 301
  • 1
  • 4
  • 9
0
votes
1 answer

Creating two datasource with Spring

I'm trying to add two data sources in my Spring project, however, I'm getting this error org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ajaxController': Injection of persistence dependencies failed; nested…
bmarkham
  • 1,590
  • 15
  • 27
0
votes
1 answer

Spring 4 Jpa Hibernate - Can't Inject EntityManager

I guess I have the same problem as many people, but unsolved on most of cases. I will try anyway, hope you guys can help me. The problem is in my repository when I try to inject que Entity Manager using @persistenceContext annotation and always…
0
votes
1 answer

What Determines a persistence unit

I am creating a Java EE application and have setup my persistence using hibernate. Since I do not see this app being all that big I do not see the point in using EJBs so I created a PersistenceUtil class to manage my EntityManagerFactory. Something…
nerdlyist
  • 2,842
  • 2
  • 20
  • 32
0
votes
1 answer

java.lang.IllegalStateException: Unable to retrieve EntityManagerFactory for unitName CarLocPU

I'm beginning Java EE with NetBeans 8.1, Glassfish 4.1 and Apache Derby (included in GlassFish). For this purpose I'm calling to put and store a car data with its attributes. But this simple facade always returns "java.lang.IllegalStateException"…
Paul
  • 1,410
  • 1
  • 14
  • 30
0
votes
1 answer

Non-referred persistenceunit init throwing DuplicateServiceException: __FIRST_PHASE__ is already registered?

I am deploying multiple war's and ear's in my Wildfly 8.1. Recently I migrated some code from hibernate to jpa in one of the jar's which is shared between a ear and a war.So this is how it goes yy.ear -> persistence.xml(ds2,ds3,ds4) -> myjpa.jar …
eminemence
  • 721
  • 1
  • 6
  • 21
0
votes
0 answers

separate persistence context for PostgreSQL's schema

I would like to have a separate persistence context within the same database but different schema. I'm using Eclipselink as JPA implementation and database is PostgreSQL. The database should contain 2 schemas: --txDBS \_data.scheme …
greengold
  • 1,184
  • 3
  • 18
  • 43