persistence.xml

Can not create EntityManager factory bc JTA tx manager requiered

非 Y 不嫁゛ 提交于 2019-12-02 11:49:58
I can not build my entity manager factory and the error I get is "chosen transaction strategy requires access to the JTA Transaction Manager". Can anyone advise what i have to configure to get past this? FYI I'm using Jboss 6, no spring. Here is my persistance.xml <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> <persistence-unit name="AvengersPU" transaction-type="JTA"> <jta-data-source>java:/jdbc

JPA and toplink create-table on if they don't already exist?

女生的网名这么多〃 提交于 2019-12-01 17:13:25
Looks like jpa is something which makes me ask a lot of questions. Having added this <property name="toplink.ddl-generation" value="create-tables"/> my JPA application always creates tables when running, which results in exceptions in case the tables already exist. I would like JPA to check if the tables already exist and if not create them, however I could not find a value for the property above which does this. So if I just turn it off, is there a way to tell JPA manually at some point to create all the tables? Update here's the exception I get Internal Exception: com.mysql.jdbc.exceptions

Infinispan - set per Entity expiration.lifespan

隐身守侯 提交于 2019-12-01 06:25:34
问题 I have a java web application deployed on Jboss 6.1.0, that uses infinispan 5.2.6.Final. I'm trying to set a per Entity specific expiration.lifespan following this guide http://infinispan.org/docs/5.2.x/user_guide/user_guide.html#_advanced_configuration_2 for my Entity bean com.myenterprise.myproject.dal.ejb.entity.RefStatus. The guide states the following: You can also override eviction/expiration settings on a per entity/collection type basis in such way that the overriden settings only

why EntityManager is null?

旧街凉风 提交于 2019-11-30 20:08:44
In my web applicaton I use OpenJPA on Apache Tomcat (TomEE)/7.0.37 server. I use Netbeans to auto generate class ("Entity Class from database..." and "Session Beans From Entity Class..."). At SessionBean (for example UserFacade) i want to get EntityManager: @Stateless public class UserFacade extends AbstractFacade<User> { @PersistenceContext(unitName = "CollDocPU") private EntityManager em; @Override protected EntityManager getEntityManager() { return em; } } but when i get it by above way I get null. When I make it by: @Override protected EntityManager getEntityManager() {

persistence.xml to import database parameters values from .properties file

别说谁变了你拦得住时间么 提交于 2019-11-30 18:45:33
Edit: not duplicate but almost I would like to have my app persistence.xml to be something like <?xml version="1.0" encoding="UTF-8"?> <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0"> <persistence-unit name="appName" transaction-type="RESOURCE_LOCAL"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <properties> <property name="hibernate.dialect" value="${db.dialect'}"/> <property name=

JPA without persistence.xml

牧云@^-^@ 提交于 2019-11-30 16:04:33
I'm trying to get started with using Guice Persist and JPA, which recommends using configuration via persistence.xml. Coming from a native Hibernate background where configuration was obtained programmatically, is there a simple way to configure a JpaPersistModule without a persistence.xml file, or will a rump persistence.xml always have to exist? If no such option exists, it might be the case where I might have to play around with PersistenceProvider (assuming the "default" parses persistence.xml somehow). Any tutorials on working with the JPA SPI? Javier Sánchez There is no need for

Eclipse - How to fix error “No persistence.xml file found in project” JPA issue

◇◆丶佛笑我妖孽 提交于 2019-11-30 11:19:51
Error "No persistence.xml file found in project" in Eclipse. Aim: Create a new project GWT+App engine+Maven Steps to create this: Google eclipse plugin: select "New Web Application Project". set the name etc. right-click on the project > Configure > Convert to Maven... Fix jdoconfig.xml file: xsi has the wrong value. see Validating jdoconfig with incorrect url Then I get the above error. The file exists at scr/META-INF/persistence.xml and also war/WEB-INF/classes/META-INF/persistence.xml But is not being found. Notes: I installed plugins m2e, m2e-wtp and google eclipse plugin If you are using

persistence.xml to import database parameters values from .properties file

我只是一个虾纸丫 提交于 2019-11-30 02:58:27
问题 Edit: not duplicate but almost I would like to have my app persistence.xml to be something like <?xml version="1.0" encoding="UTF-8"?> <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0"> <persistence-unit name="appName" transaction-type="RESOURCE_LOCAL"> <provider>org.hibernate.ejb

persistence.xml with Glassfish 3.1.1

旧巷老猫 提交于 2019-11-30 02:10:49
I am very new to glassfish, JPA and so on and I have really problems with setting that up. What I am planning to do is a simple RESTful service with a persistent backend. I am using glassfish3 as application server and already deployed a simple REST service with the jersey-library. Now I want to provide access to a database via JPA. Glassfish is shipped with JavaDB/derby and EclipseLink, is that right? So, I want to use that :-) I created a persistence.xml in META-INF: <?xml version="1.0" encoding="UTF-8"?> <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi=

Where to put persistence.xml in library jar using maven?

痴心易碎 提交于 2019-11-29 23:36:53
At work we have an entity library which is used by several clients for the library (several servlets, a desktop application, etc.). The entity library consists of JPA-Annotated classes and most prominently a persistence.xml. All projects are configured using maven. Where should a persistence.xml file be put? It needs to be located inside the jar file of that entity library and I'm not sure how to configure this using maven. (We are just splitting up a project into several smaller projects) '''UPDATE''' To be clear about this, there is one Maven-Project A containing the persistence.xml and