Hi Greg, I am attaching:
persistence.xml hibernate_processInstanceDS.cfg.xml META-INF/context.xml conf/context.xml resources.properties btm-config.properties and I have this in the web.xml <resource-env-ref> <resource-env-ref-name>jdbc/processInstanceDS</resource-env-ref-name> <resource-env-ref-type>javax.sql.DataSource</resource-env-ref-type> </resource-env-ref> I appreciate your help Thanks On Fri, Aug 27, 2010 at 9:52 AM, Chrystall, Greg <gchryst...@nds.com> wrote: > Yes you do need transaction management. > > How is your datasource configured in hibernate? > > Are you using jndi? > > This may help: > > http://docs.codehaus.org/display/BTM/Jndi13 > > The bit you want is this: > > You just have to create a jndi.properties file in your classpath with this > content: > > java.naming.factory.initial=bitronix.tm.jndi.BitronixInitialContextFactory > > -----Original Message----- > From: rules-users-boun...@lists.jboss.org > [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Gustavo Tenrreiro > Sent: 27 August 2010 15:36 > To: rules-users@lists.jboss.org > Subject: [rules-users] Is transaction management required for Drools process > / session persistence > > Hi, > > I am trying to do Drools persistence in Tomcat with Hibernate, but it > would seem it also requires transaction management. Is that true? > > In the meantime I tried to setup Bittronix to provide the transaction > management, but I can't get Hibernate to find the datasource at all. > > I ve followed the BTM integration instructions for Tomcat, I ve also > done followed the BTM integration instructions for Hibernate, but > still nothing, Hibernate keeps saying it can't find the datasource. > > Can anyone shed some light on this ? > > BTW: my database is SQL Server > > Thanks > _______________________________________________ > rules-users mailing list > rules-users@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/rules-users > > > ************************************************************************************** > This message is confidential and intended only for the addressee. If you have > received this message in error, please immediately notify the > postmas...@nds.com and delete it from your system as well as any copies. The > content of e-mails as well as traffic data may be monitored by NDS for > employment and security purposes. To protect the environment please do not > print this e-mail unless necessary. > > NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 > 4EX, United Kingdom. A company registered in England and Wales. Registered > no. 3080780. VAT no. GB 603 8808 40-00 > ************************************************************************************** > > _______________________________________________ > rules-users mailing list > rules-users@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/rules-users >
btm-config.properties
Description: Binary data
<!-- The contents of this file will be loaded for each web application --> <Context> <!-- Default set of monitored resources --> <WatchedResource>WEB-INF/web.xml</WatchedResource> <Transaction factory="bitronix.tm.BitronixUserTransactionObjectFactory" /> <!-- Uncomment this to disable session persistence across Tomcat restarts --> <!-- <Manager pathname="" /> --> </Context>
resources.properties
Description: Binary data
<Context> <Resource name="jdbc/processInstanceDS" auth="Container" type="javax.sql.DataSource" factory="bitronix.tm.resource.ResourceObjectFactory" uniqueName="jdbc/processInstanceDS" /> </Context>
<?xml version='1.0' encoding='utf-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="hibernate.connection.datasource">jdbc/processInstanceDS2</property> <property name="hibernate.connection.release_mode">after_statement</property> <property name="hibernate.current_session_context_class">jta</property> <property name="transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property> <property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.BTMTransactionManagerLookup</property> <property name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</property> <property name="hibernate.cache.provider_class">org.hibernate.cache.NoCacheProvider</property> <property name="hibernate.show_sql">true</property> <property name="hibernate.jndi.class" value="bitronix.tm.jndi.BitronixInitialContextFactory" /> </session-factory> </hibernate-configuration>
<?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/persistence_1_0.xsd http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd" xmlns:orm="http://java.sun.com/xml/ns/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/persistence"> <persistence-unit name="org.drools.task" transaction-type="JTA"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <jta-data-source>jdbc/processInstanceDS2</jta-data-source> <class>org.drools.task.Attachment</class> <class>org.drools.task.Content</class> <class>org.drools.task.BooleanExpression</class> <class>org.drools.task.Comment</class> <class>org.drools.task.Deadline</class> <class>org.drools.task.Comment</class> <class>org.drools.task.Deadline</class> <class>org.drools.task.Delegation</class> <class>org.drools.task.Escalation</class> <class>org.drools.task.Group</class> <class>org.drools.task.I18NText</class> <class>org.drools.task.Notification</class> <class>org.drools.task.EmailNotification</class> <class>org.drools.task.EmailNotificationHeader</class> <class>org.drools.task.PeopleAssignments</class> <class>org.drools.task.Reassignment</class> <class>org.drools.task.Status</class> <class>org.drools.task.Task</class> <class>org.drools.task.TaskData</class> <class>org.drools.task.SubTasksStrategy</class> <class>org.drools.task.OnParentAbortAllSubTasksEndStrategy</class> <class>org.drools.task.OnAllSubTasksEndParentEndStrategy</class> <class>org.drools.task.User</class> <class>org.drools.persistence.session.SessionInfo</class> <class>org.drools.persistence.processinstance.ProcessInstanceInfo</class> <class>org.drools.persistence.processinstance.ProcessInstanceEventInfo</class> <class>org.drools.persistence.processinstance.WorkItemInfo</class> <class>org.drools.persistence.processinstance.variabletypes.VariableInstanceInfo</class> <properties> <!-- <property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/> <property name="hibernate.connection.driver_class" value="org.h2.Driver"/> <property name="hibernate.connection.url" value="jdbc:h2:mem:mydb" /> <property name="hibernate.connection.username" value="sa"/> <property name="hibernate.connection.password" value="sasa"/> <property name="hibernate.connection.autocommit" value="false" /> <property name="hibernate.max_fetch_depth" value="3"/> <property name="hibernate.hbm2ddl.auto" value="create" /> <property name="hibernate.show_sql" value="true" /> --> <property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/> <!-- <property name="hibernate.connection.driver_class" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/> <property name="hibernate.connection.url" value="jdbc:sqlserver://CMCK-CSSDEVIT01;instanceName=ITAR01;selectMethod=direct;sendStringParametersAsUnicode=false;responseBuffering=full;databaseName=troux9" /> <property name="hibernate.connection.username" value="troux9_user"/> <property name="hibernate.connection.password" value="dEQaTadr3JAc"/> --> <property name="hibernate.connection.autocommit" value="false" /> <property name="hibernate.max_fetch_depth" value="3"/> <property name="hibernate.hbm2ddl.auto" value="create" /> <property name="hibernate.show_sql" value="true" /> <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.BTMTransactionManagerLookup" /> <property name="hibernate.jndi.class" value="bitronix.tm.jndi.BitronixInitialContextFactory" /> <!-- <property name="hibernate.connection.datasource">jdbc/processInstanceDS</property> <property name="hibernate.current_session_context_class">jta</property> --> </properties> </persistence-unit> </persistence>
_______________________________________________ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users