[jboss-user] [jBPM] - About persistence in jBPM5
Yu Chai
do-not-reply at jboss.com
Wed Nov 30 19:14:11 EST 2011
Yu Chai [http://community.jboss.org/people/cross.cy] created the discussion
"About persistence in jBPM5"
To view the discussion, visit: http://community.jboss.org/message/639209#639209
--------------------------------------------------------------
Hi,
I'm running a test workflow in a standard Java Application, without using and container or web server. I followed the Configuring Persistence section of the user guide carefully. However I encountered a javax.naming.NameNotFoundException saying "Name testDS1 not found". In my program i have :
PoolingDataSource ds1 = new PoolingDataSource();
ds1 = new PoolingDataSource();
ds1.setUniqueName("jdbc/testDS1");
ds1.setClassName("org.h2.jdbcx.JdbcDataSource");
ds1.setMaxPoolSize(3);
ds1.setAllowLocalTransactions(true);
ds1.getDriverProperties().put("user", "sa");
ds1.getDriverProperties().put("password", "");
ds1.getDriverProperties().put("URL", "jdbc:h2:tcp://localhost/~/test");
ds1.init();
My persistence.xml is:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<persistence
version="1.0"
xsi:schemaLocation=
" http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd
http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm
http://java.sun.com/xml/ns/persistence/orm_1_0.xsd http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
xmlns:orm=" http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance"
xmlns=" http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence">
<persistence-unit name="org.jbpm.persistence.jpa">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>jdbc/testDS1</jta-data-source>
<class>org.drools.persistence.info.SessionInfo</class>
<class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>
<class>org.drools.persistence.info.WorkItemInfo</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
<property name="hibernate.max_fetch_depth" value="3"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.BTMTransactionManagerLookup"/>
</properties>
</persistence-unit>
</persistence>
It looks like ds1.setUniqueName("jdbc/testDS1") didn't work. Any suggestion? Thanks!
Best regards
Yu
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/639209#639209]
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/20111130/67ee7381/attachment-0001.html
More information about the jboss-user
mailing list