[jboss-user] [jBPM] - Re: JBPM's persistence reusing existing connection
Andres Fernandez
do-not-reply at jboss.com
Wed Dec 21 07:24:42 EST 2011
Andres Fernandez [http://community.jboss.org/people/ysh_fdez] created the discussion
"Re: JBPM's persistence reusing existing connection"
To view the discussion, visit: http://community.jboss.org/message/642657#642657
--------------------------------------------------------------
> The second option that you are trying makes no sense at all.
> You should continue trying with the first one.. looking how to create a persistence unit and inject the current session that you have available.
Great, it's good know it :) I will discard the second option and continue with the first.
> I remember an article that explains how to create a new persistence unit using a persistence.xml file and then inject the session inside it once is created. You should try that option.
My partner is doing tested using a persistence.xml file but I think it's different that you mention. Coincidentally he gets the same error I get in my first choice.
EntityManagerFactory emf = Persistence.createEntityManagerFactory( "manager" ); //manager name file persistence
Environment env = KnowledgeBaseFactory.newEnvironment();
env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);
persistence.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<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_2_0.xsd"
version="2.0">
<persistence-unit name="manager" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<!-- <jta-data-source>jdbc/processInstanceDS</jta-data-source> -->
<validation-mode>AUTO</validation-mode>
<properties>
<property name="hibernate.max_fetch_depth" value="3"/>
<property name="hibernate.show_sql" value="true"/>
<property name="javax.persistence.jdbc.driver" value="oracle.jdbc.driver.OracleDriver"/>
<property name="javax.persistence.jdbc.user" value="..."/>
<property name="javax.persistence.jdbc.password" value="..."/>
<property name="javax.persistence.jdbc.url" value="jdbc:oracle:thin:@..."/>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
<property name="hibernate.max_fetch_depth" value="3"/>
</properties>
</persistence-unit>
</persistence>
Greetings
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/642657#642657]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20111221/65ecf98f/attachment.html
More information about the jboss-user
mailing list