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
1
vote
2 answers

Trouble configuring Play 2 to run with JPA (persistence)

The folowing error is being showed when a try to persist data: [PersistenceException: [PersistenceUnit: update] class or package not found] In C:\Users\Johann\Desktop\SODET\play-2.1.1\todolist\app\models\Stream.java at line 32. 32 …
Johann Gomes
  • 3,813
  • 5
  • 23
  • 25
1
vote
2 answers

CWWJP0015E Error when creating entity manager factory for persistence unit

I was facing the following error when starting my EJB application in IBM WebSphere Application Server WAS 7. JPAPUnitInfo E CWWJP0015E: An error occurred in the org.hibernate.ejb.HibernatePersistence persistence provider when it attempted to…
Peter Wippermann
  • 4,125
  • 5
  • 35
  • 48
1
vote
2 answers

predeploy for PersistenceUnit failed in JBOSS with toplink essentials

When i am trying to deploy the product in jboss 5. I am using toplink-essentials for the JPA 1.0. This product is running successfully on tomcat 6. But in jboss it is showing errors. I am trying to deploy the product through Eclipse IDE. Error…
SRIHARIRAO M
  • 103
  • 1
  • 18
1
vote
0 answers

Additional readOnlyEntityManager for readOnly from Slave DB

I am exploring ways to achieve reads from slave and writes to master on a JPA based webapp using a MySQL Master/Slave. I think I have an option to pursue and like some opinions about past experiences achieving the same thing. To start with , I…
Anand Hemmige
  • 3,593
  • 6
  • 21
  • 31
1
vote
2 answers

Optional persistence unit in JPA (when using multiple persistence units)

Does JPA support optional persistence units and if so how do I configure that? I do have one persistence unit which is my main database. Then I configured another one where I just read objects from the db to do some checks. To avoid messing around…
Jens
  • 6,243
  • 1
  • 49
  • 79
1
vote
0 answers

how to use composite entities which driven by different persistence unit via using hibernate

There are 2 different persistence unit in my project. PU_A: Application entities, that can execute all crud operations. PU_B: This one has some views which contains outside data. I can just read data from here But i want to create foreign key in…
webyildirim
  • 587
  • 3
  • 12
  • 32
1
vote
3 answers

How to store persistence.xml with other configuration files

I'm using EclipseLink as my JPA implementation. Our project has a directory where we keep all of our config files, and I would like to store my persistence.xml file in the config directory, but cannot find any way to tell createEntityManagerFactory…
BostonJohn
  • 2,631
  • 2
  • 26
  • 48
1
vote
1 answer

JPA - Using Multiple data sources to define access control

I am totally new to JPA and JSF and hope you can help me with my questions. My application is built using JSF 2.0 Framework, using JPA 2.0/EclipseLink running on Glassfish 3+, MySQL. I set one persistence unit called "loginPU" using data source:…
gnowlak
  • 486
  • 1
  • 6
  • 12
0
votes
1 answer
0
votes
1 answer

Create parameterized Persistence Unit + JTA DataSource at Runtime (context dependent)

i'm trying to write an EJB3 Stateless Session Bean which gets the parameter "customerCode" (String). Dependent on this "customerCode" i want to create an EntityManager (Persistence.createEntityManagerFactory...) with a (dynamically?) created…
0
votes
1 answer

How to use same Persistence Unit to access different datasources with the same entities using EntityManager and EntityManagerFactory

I'm currently working with Java 17, Wildfly 25.0.1 and JPA over Hibernate 5.3. I have an application that uses annotations and entities mapped to access a single database. I'm using a PersistenceUnit with a Datasource, and it works fine. What I'm…
Faliorn
  • 1,351
  • 3
  • 12
  • 24
0
votes
1 answer

WildFly/Jboss/persistance-unit/Entity Manager - How to create new connection every time when user calls GET API Endpoint

I'm trying to modify existing Java app (WildFly, Jboss, oracle) which currently working fine as using persistence-unit and EntityManager connect to Oracle database(using standalone.xml and persistence.xml). However, I need to create every time new…
Marcin
  • 11
  • 1
0
votes
2 answers

solving a exception in jonas As 5.2.1 deployment

I am newbie in develloping with JOnAs platform, also in Spring and more genrally in web devellopments. After having somte troubles with JBoss 5.1.GA and tomcat 6.x,7.x i decided to move to jonas. I 'm now facing an issue in the deployment of my…
0
votes
1 answer

What is Best way to use JPA in WEBSERVICES?

i am creating a web service using 3rd party wsdl that helps me in getting a kind of notification. now i have to save that notification in DB and perform several other operations related to DataBase. in My persistence.xml there are two persistence…
maria farooq
  • 130
  • 1
  • 11
0
votes
1 answer

Hibernate + H2 in Jave EE: Define multiple persistence unit causes tests fail with "Not an entity" error except the first one

I defined 2 persistence units in my test persistence.xml to create 2 different H2 in-memory database for each integration test connecting db. The tests are fine and passing when run separately, but when I run all tests, only the first passes, and…
WesternGun
  • 11,303
  • 6
  • 88
  • 157