Questions tagged [persistence.xml]

Used with the Java Persistence API, specifies names and database properties.

When used with the Java Persistence API, the persistence.xml file is usually placed in the META-INF folder; it's used to specify the persistence provider name, entity class names, and properties like the database connection URL, driver, user, password, and so on (taken from http://www.javaworld.com/javaworld/jw-01-2008/jw-01-jpa1.html?page=3).

519 questions
0
votes
2 answers

integrating between multiple persistence units (xa and non-xa) in javaee

I have two persistence units in my persistence.xml, one XA and another non-xa (to increase performance when work is only releated to a single datasource and I dont need global transaction).
A. Abouei
  • 51
  • 6
0
votes
0 answers

How can I set values in persistence.xml?

I have tried to load the url, user and password in different ways, but I can't get it to connect. Currently I use a file called config.properties from where I retrieve the credentials to connect to the database. Persistence file
Chisrra
  • 3
  • 1
0
votes
0 answers

How to pull values from properties file into persistence.xml and context.xml?

I have an app with Java 17, Tomcat 10. I would like to use a properties file (or its variation) so I can read it from different sides of my code or from my persistence.xml and context.xml files. What have I tried? I created a properties file and…
0
votes
1 answer

Stackoverflow at predeployment of PersistenceUnit Jakarta EE10

The migration of a Webapplication from Java EE8 to Jakarta EE10 based on Payara Fish 6.2023.6 failed during deployment. WARNUNG: Unsupported deployment descriptors element schemalocation value https://jakarta.ee/xml/ns/persistence…
dirk
  • 1
  • 3
0
votes
0 answers

OpenJPA upgrade for jakarta persistence api

I have been trying to upgrade my project to spring 3.1.0 . It currently uses OpenJpa with java persistence schema 1.x. If I upgrade the javax.persistence packages to jakarta.persistence packages, with…
Abha
  • 1
  • 1
0
votes
0 answers

MySQL to ObjectDB Migration

A maven JEE project using JSF, JPA (EclipseLink 2.3) is using MySQL comminity edition as the database. With the size of the database exceeding 20GB, there are database related peformance issues. As a solution, I am going to use ObjectDB. I am doing…
0
votes
1 answer

Hibernate timeout in WildFly

Where I can define the timeout for queries within hibernate in WildFly environment, is it the persistence.xml? And what is the default value?
DB2fan
  • 23
  • 3
0
votes
0 answers

Maven Java Project: Having errors on my pom.xml trying to use JPA on eclipse

I'm working on a project that will use JPA to persist and retrieve objects from my SQL workbench database. Whenever i'm trying to utilise the EntityManager from JPA i get an error: Error: Exception in Application start…
darjow
  • 39
  • 8
0
votes
1 answer

How do I do JPA Batches (Insert) in EclipseLink

I want do use JPA Batches in my code. I am using this Dependencies: org.eclipse.persistence eclipselink 2.5.1
Phil
  • 35
  • 8
0
votes
1 answer

Set value of persistence.xml file with properties.config file

I want to set the values of my persistence.xml file with the values from my properties.config. Is there any way to do this? Like any buildin function? I think to a function like factory.setvaluesfrompersistence(config.getpropertie("name")); I want…
Phil
  • 35
  • 8
0
votes
1 answer

Metamodel and the Persistence.xml file

I'm new to Spring Framework and trying to create dynamic search queries for an sql database- similar to what is described in the below thread. Filtering database rows with spring-data-jpa and spring-mvc This thread provided a useful guide however…
0
votes
2 answers

Is there any alternative to provide user and password to Hibernate reactive without persistance.xml?

I am trying to figure out a way to provide user and password without hardcoding them on the same server. I need to fetch them through an api.
0
votes
1 answer

How to make credentials in persistence.xml programmatic?

I have persistence.xml file which is used to load database and connections. I have the username and password stored in it like this: