<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
Re: JBPM on Glassfish steps to install
</h3>
<span style="margin-bottom: 10px;">
created by <a href="http://community.jboss.org/people/odelyaholiday">Odelya Holiday</a> in <i>jBPM</i> - <a href="http://community.jboss.org/message/627059#627059">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Hi!</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>So far I worked with Tomcat for my workflow development. </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>In order to work with data pooling I defined in context xml:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><Resource </p><p>    name="jdbc/flow"</p><p>    auth="Container"</p><p>    type="javax.sql.DataSource"</p><p>    maxActive="40"</p><p>    maxIdle="2"</p><p>    username="myname"</p><p>    maxWait="5000"</p><p>    driverClassName="oracle.jdbc.driver.OracleDriver"</p><p>    password="workflow_cust"</p><p>    url="myurl"/> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>and of course resource.properties:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>resource.ds1.className=bitronix.tm.resource.jdbc.lrc.LrcXADataSource</p><p>resource.ds1.uniqueName=jdbc/flow</p><p>resource.ds1.minPoolSize=0 </p><p>resource.ds1.maxPoolSize=5 </p><p>resource.ds1.driverProperties.driverClassName=oracle.jdbc.OracleDriver</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>as well as in persistence:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><persistence-unit name="org.drools.persistence.jpa" transaction-type="JTA"></p><p>                    <provider>org.hibernate.ejb.HibernatePersistence</provider></p><p>                    <jta-data-source>java:comp/env/jdbc/flow</jta-data-source></p><p>                    <mapping-file>persistenceorm.xml</mapping-file></p><p>                    <class>org.drools.persistence.info.SessionInfo</class></p><p>                    <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class></p><p>                    <class>org.drools.persistence.info.WorkItemInfo</class></p><p>                    <exclude-unlisted-classes>true</exclude-unlisted-classes></p><p>                    <properties></p><p>                              <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" /></p><p>                              <property name="hibernate.connection.autocommit" value="false" /></p><p>                              <property name="hibernate.max_fetch_depth" value="3" /></p><p>                              <property name="hibernate.show_sql" value="true" /></p><p>                              <property name="hibernate.connection.driver_class" value="oracle.jdbc.driver.OracleDriver" /></p><p>                              <property name="hibernate.transaction.manager_lookup_class"</p><p>                                        value="org.hibernate.transaction.BTMTransactionManagerLookup" /></p><p>                    </properties></p><p>          </persistence-unit></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><strong>Now I just defined in glassfish manager the new database pooling:</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>datasource classname: oracle.jdbc.pool.OracleConnectionPoolDataSource</p><p>resource type: oracle.jdbc.pool.OracleDataSource</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>However, when the server starts I get:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Caused by: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not get next sequence value</p><p>          at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)</p><p>          at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:226)</p><p>          at org.drools.persistence.jpa.JpaPersistenceContext.persist(JpaPersistenceContext.java:17)</p><p>          at org.drools.persistence.SingleSessionCommandService.<init>(SingleSessionCommandService.java:125)</p><p>          ... 72 more</p><p>Caused by: org.hibernate.exception.SQLGrammarException: could not get next sequence value</p><p>          at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:90)</p><p>          at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)</p><p>          at org.hibernate.id.SequenceGenerator.generate(SequenceGenerator.java:119)</p><p>          at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:122)</p><p>          at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:49)</p><p>          at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:154)</p><p>          at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:110)</p><p>          at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:61)</p><p>          at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:645)</p><p>          at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:619)</p><p>          at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:623)</p><p>          at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:220)</p><p>          ... 74 more</p><p>Caused by: java.sql.SQLException: ORA-02289: sequence does not exist</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>This is after:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.drools.persistence.jpa");</p><p>                    Environment env = KnowledgeBaseFactory.newEnvironment();</p><p>                    env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);</p><p>                    env.set(EnvironmentName.GLOBALS, new MapGlobalResolver());</p><p>                    env.set(EnvironmentName.TRANSACTION_MANAGER, TransactionManagerServices.getTransactionManager());</p><p>                    ksession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env);</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>What do I need to define in glassfish in order to make it work?</p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/627059#627059">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in jBPM at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>