11 Replies Latest reply on Jan 16, 2010 7:01 AM by kukeltje

    JBPM won't save data in the database

      Hi there,

       

      I have a strange problem, and I can't figure out what I'm doing wrong. I hope you'll be able to help me with that

       

      I installed JBPM 4 into a Liferay Portal (5.2 EE edition) with Mysql 5, and it runs very well... except that all process definitions I create, or process instances I launch are only "cached", and never stored in the database. Then, all is gone when I restart the server, or when I deploy my war. I was able to identify this behaviour launching a debug in the server. While in debug mode, I could do whatever I wanted to (loading definitions, create instances, and so forth).

       

      Here's a quick summary of what I've tried (then I'll show config files) :

      - Use auto-commit = true --> Nothing changed

      - Use hibernate.cache.provider_class = org.hibernate.cache.HashtableCacheProvider --> Nothing changed

      - Use hibernate.transaction.factory_class = org.hibernate.transaction.JDBCTransactionFactory --> Nothing changed

       

      Here is the server log, when I launch some JBPM (I tried to put in red some intersting points)

      16:43:56,885 INFO  [Environment:543] Hibernate 3.3.1.GA

      16:43:56,897 INFO  [Environment:561] loaded properties from resource hibernate.properties: {hibernate.connection.driver_class=com.mysql.jdbc.Driver, hibernate.c3p0.max_size=3, hibernate.dialect=org.hibernate.dialect.MySQLDialect, hibernate.c3p0.min_size=1, hibernate.query.substitutions=true 1, false 0 , hibernate.connection.username=root, hibernate.connection.url=jdbc:mysql://localhost:3306/sel, hibernate.bytecode.use_reflection_optimizer=false, hibernate.show_sql=true, hibernate.connection.password=****}

      16:43:56,902 INFO  [Environment:709] Bytecode provider name : javassist

      16:43:56,910 INFO  [Environment:627] using JDK 1.4 java.sql.Timestamp handling

      16:43:57,010 INFO  [Configuration:1460] configuring from resource: jbpm.hibernate.cfg.xml

      16:43:57,011 INFO  [Configuration:1437] Configuration resource: jbpm.hibernate.cfg.xml

      16:43:57,175 INFO  [Configuration:586] Reading mappings from resource : jbpm.repository.hbm.xml

      16:43:57,265 INFO  [HbmBinder:322] Mapping class: org.jbpm.pvm.internal.repository.DeploymentImpl -> JBPM4_DEPLOYMENT

      16:43:57,319 INFO  [HbmBinder:322] Mapping class: org.jbpm.pvm.internal.repository.DeploymentProperty -> JBPM4_DEPLOYPROP

      16:43:57,435 INFO  [HbmBinder:322] Mapping class: org.jbpm.pvm.internal.id.PropertyImpl -> JBPM4_PROPERTY

      16:43:57,437 INFO  [Configuration:586] Reading mappings from resource : jbpm.execution.hbm.xml

      16:43:57,464 INFO  [HbmBinder:322] Mapping class: org.jbpm.pvm.internal.model.ExecutionImpl -> JBPM4_EXECUTION

      16:43:57,561 INFO  [HbmBinder:322] Mapping class: org.jbpm.pvm.internal.type.Variable -> JBPM4_VARIABLE

      16:43:57,600 INFO  [HbmBinder:836] Mapping subclass: org.jbpm.pvm.internal.type.variable.BlobVariable -> JBPM4_VARIABLE

      16:43:57,602 INFO  [HbmBinder:836] Mapping subclass: org.jbpm.pvm.internal.type.variable.DateVariable -> JBPM4_VARIABLE

      16:43:57,603 INFO  [HbmBinder:836] Mapping subclass: org.jbpm.pvm.internal.type.variable.DoubleVariable -> JBPM4_VARIABLE

      16:43:57,604 INFO  [HbmBinder:836] Mapping subclass: org.jbpm.pvm.internal.type.variable.HibernateLongVariable -> JBPM4_VARIABLE

      16:43:57,605 INFO  [HbmBinder:836] Mapping subclass: org.jbpm.pvm.internal.type.variable.HibernateStringVariable -> JBPM4_VARIABLE

      16:43:57,606 INFO  [HbmBinder:836] Mapping subclass: org.jbpm.pvm.internal.type.variable.LongVariable -> JBPM4_VARIABLE

      16:43:57,607 INFO  [HbmBinder:836] Mapping subclass: org.jbpm.pvm.internal.type.variable.NullVariable -> JBPM4_VARIABLE

      16:43:57,608 INFO  [HbmBinder:836] Mapping subclass: org.jbpm.pvm.internal.type.variable.StringVariable -> JBPM4_VARIABLE

      16:43:57,609 INFO  [HbmBinder:836] Mapping subclass: org.jbpm.pvm.internal.type.variable.TextVariable -> JBPM4_VARIABLE

      16:43:57,610 INFO  [HbmBinder:322] Mapping class: org.jbpm.pvm.internal.lob.Lob -> JBPM4_LOB

      16:43:57,616 INFO  [HbmBinder:322] Mapping class: org.jbpm.pvm.internal.job.JobImpl -> JBPM4_JOB

      16:43:57,621 INFO  [HbmBinder:836] Mapping subclass: org.jbpm.pvm.internal.job.MessageImpl -> JBPM4_JOB

      16:43:57,622 INFO  [HbmBinder:836] Mapping subclass: org.jbpm.pvm.internal.model.op.ExecuteActivityMessage -> JBPM4_JOB

      16:43:57,624 INFO  [HbmBinder:836] Mapping subclass: org.jbpm.pvm.internal.model.op.ExecuteEventListenerMessage -> JBPM4_JOB

      16:43:57,625 INFO  [HbmBinder:836] Mapping subclass: org.jbpm.pvm.internal.job.CommandMessage -> JBPM4_JOB

      16:43:57,626 INFO  [HbmBinder:836] Mapping subclass: org.jbpm.pvm.internal.job.TimerImpl -> JBPM4_JOB

      16:43:57,629 INFO  [Configuration:586] Reading mappings from resource : jbpm.history.hbm.xml

      16:43:57,654 INFO  [HbmBinder:322] Mapping class: org.jbpm.pvm.internal.history.model.HistoryProcessInstanceImpl -> JBPM4_HIST_PROCINST

      16:43:57,662 INFO  [HbmBinder:322] Mapping class: org.jbpm.pvm.internal.history.model.HistoryActivityInstanceImpl -> JBPM4_HIST_ACTINST

      16:43:57,670 INFO  [HbmBinder:836] Mapping subclass: org.jbpm.pvm.internal.history.model.HistoryAutomaticInstanceImpl -> JBPM4_HIST_ACTINST

      16:43:57,671 INFO  [HbmBinder:836] Mapping subclass: org.jbpm.pvm.internal.history.model.HistoryDecisionInstanceImpl -> JBPM4_HIST_ACTINST

      16:43:57,672 INFO  [HbmBinder:836] Mapping subclass: org.jbpm.pvm.internal.history.model.HistoryTaskInstanceImpl -> JBPM4_HIST_ACTINST

      16:43:57,673 INFO  [HbmBinder:322] Mapping class: org.jbpm.pvm.internal.history.model.HistoryTaskImpl -> JBPM4_HIST_TASK

      16:43:57,687 INFO  [HbmBinder:322] Mapping class: org.jbpm.pvm.internal.history.model.HistoryVariableImpl -> JBPM4_HIST_VAR

      16:43:57,700 INFO  [HbmBinder:322] Mapping class: org.jbpm.pvm.internal.history.model.HistoryDetailImpl -> JBPM4_HIST_DETAIL

      16:43:57,704 INFO  [HbmBinder:836] Mapping subclass: org.jbpm.pvm.internal.history.model.HistoryCommentImpl -> JBPM4_HIST_DETAIL

      16:43:57,705 INFO  [HbmBinder:836] Mapping subclass: org.jbpm.pvm.internal.history.model.HistoryProcessInstanceMigrationImpl -> JBPM4_HIST_DETAIL

      16:43:57,765 INFO  [HbmBinder:836] Mapping subclass: org.jbpm.pvm.internal.history.model.HistoryPriorityUpdateImpl -> JBPM4_HIST_DETAIL

      16:43:57,767 INFO  [HbmBinder:836] Mapping subclass: org.jbpm.pvm.internal.history.model.HistoryTaskAssignmentImpl -> JBPM4_HIST_DETAIL

      16:43:57,768 INFO  [HbmBinder:836] Mapping subclass: org.jbpm.pvm.internal.history.model.HistoryTaskDuedateUpdateImpl -> JBPM4_HIST_DETAIL

      16:43:57,769 INFO  [HbmBinder:836] Mapping subclass: org.jbpm.pvm.internal.history.model.HistoryVariableUpdateImpl -> JBPM4_HIST_DETAIL

      16:43:57,770 INFO  [Configuration:586] Reading mappings from resource : jbpm.task.hbm.xml

      16:43:57,791 INFO  [HbmBinder:322] Mapping class: org.jbpm.pvm.internal.task.TaskImpl -> JBPM4_TASK

      16:43:57,807 INFO  [HbmBinder:322] Mapping class: org.jbpm.pvm.internal.task.ParticipationImpl -> JBPM4_PARTICIPATION

      16:43:57,809 INFO  [HbmBinder:322] Mapping class: org.jbpm.pvm.internal.task.SwimlaneImpl -> JBPM4_SWIMLANE

      16:43:57,812 INFO  [Configuration:586] Reading mappings from resource : jbpm.identity.hbm.xml

      16:43:57,828 INFO  [HbmBinder:322] Mapping class: org.jbpm.pvm.internal.identity.impl.UserImpl -> JBPM4_ID_USER

      16:43:57,834 INFO  [HbmBinder:322] Mapping class: org.jbpm.pvm.internal.identity.impl.MembershipImpl -> JBPM4_ID_MEMBERSHIP

      16:43:57,839 INFO  [HbmBinder:322] Mapping class: org.jbpm.pvm.internal.identity.impl.GroupImpl -> JBPM4_ID_GROUP

      16:43:57,843 INFO  [Configuration:1575] Configured SessionFactory: null

      16:43:57,845 INFO  [HbmBinder:2404] Mapping collection: org.jbpm.pvm.internal.repository.DeploymentImpl.resources -> JBPM4_LOB

      16:43:57,846 INFO  [HbmBinder:2404] Mapping collection: org.jbpm.pvm.internal.repository.DeploymentImpl.objectProperties -> JBPM4_DEPLOYPROP

      16:43:57,848 INFO  [HbmBinder:2404] Mapping collection: org.jbpm.pvm.internal.model.ExecutionImpl.variables -> JBPM4_VARIABLE

      16:43:57,849 INFO  [HbmBinder:2404] Mapping collection: org.jbpm.pvm.internal.model.ExecutionImpl.systemVariables -> JBPM4_VARIABLE

      16:43:57,849 INFO  [HbmBinder:2404] Mapping collection: org.jbpm.pvm.internal.model.ExecutionImpl.executions -> JBPM4_EXECUTION

      16:43:57,850 INFO  [HbmBinder:2404] Mapping collection: org.jbpm.pvm.internal.model.ExecutionImpl.swimlanes -> JBPM4_SWIMLANE

      16:43:57,850 INFO  [HbmBinder:2404] Mapping collection: org.jbpm.pvm.internal.history.model.HistoryProcessInstanceImpl.historyActivityInstances -> JBPM4_HIST_ACTINST

      16:43:57,851 INFO  [HbmBinder:2404] Mapping collection: org.jbpm.pvm.internal.history.model.HistoryProcessInstanceImpl.historyVariables -> JBPM4_HIST_VAR

      16:43:57,852 INFO  [HbmBinder:2404] Mapping collection: org.jbpm.pvm.internal.history.model.HistoryProcessInstanceImpl.details -> JBPM4_HIST_DETAIL

      16:43:57,852 INFO  [HbmBinder:2404] Mapping collection: org.jbpm.pvm.internal.history.model.HistoryActivityInstanceImpl.details -> JBPM4_HIST_DETAIL

      16:43:57,853 INFO  [HbmBinder:2404] Mapping collection: org.jbpm.pvm.internal.history.model.HistoryTaskImpl.details -> JBPM4_HIST_DETAIL

      16:43:57,854 INFO  [HbmBinder:2404] Mapping collection: org.jbpm.pvm.internal.history.model.HistoryTaskImpl.historyVariables -> JBPM4_HIST_VAR

      16:43:57,854 INFO  [HbmBinder:2404] Mapping collection: org.jbpm.pvm.internal.history.model.HistoryTaskImpl.subTasks -> JBPM4_HIST_TASK

      16:43:57,863 INFO  [HbmBinder:2404] Mapping collection: org.jbpm.pvm.internal.history.model.HistoryVariableImpl.details -> JBPM4_HIST_DETAIL

      16:43:57,864 INFO  [HbmBinder:2404] Mapping collection: org.jbpm.pvm.internal.history.model.HistoryCommentImpl.replies -> JBPM4_HIST_DETAIL

      16:43:57,865 INFO  [HbmBinder:2404] Mapping collection: org.jbpm.pvm.internal.task.TaskImpl.participations -> JBPM4_PARTICIPATION

      16:43:57,865 INFO  [HbmBinder:2404] Mapping collection: org.jbpm.pvm.internal.task.TaskImpl.variables -> JBPM4_VARIABLE

      16:43:57,867 INFO  [HbmBinder:2404] Mapping collection: org.jbpm.pvm.internal.task.TaskImpl.subTasks -> JBPM4_TASK

      16:43:57,868 INFO  [HbmBinder:2404] Mapping collection: org.jbpm.pvm.internal.task.SwimlaneImpl.participations -> JBPM4_PARTICIPATION

      16:43:57,899 INFO  [DriverManagerConnectionProvider:64] Using Hibernate built-in connection pool (not for production use!)

      16:43:57,900 INFO  [DriverManagerConnectionProvider:65] Hibernate connection pool size: 20

      16:43:57,901 INFO  [DriverManagerConnectionProvider:68] autocommit mode: false

      16:43:57,902 INFO  [DriverManagerConnectionProvider:103] using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost/sel?useUnicode=true&characterEncoding=UTF-8

      16:43:57,903 INFO  [DriverManagerConnectionProvider:109] connection properties: {user=root, password=****}

      16:43:57,949 INFO  [SettingsFactory:116] RDBMS: MySQL, version: 5.1.30

      16:43:57,951 INFO  [SettingsFactory:117] JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.0.8 ( Revision: ${svn.Revision} )

      16:43:57,991 INFO  [Dialect:175] Using dialect: org.hibernate.dialect.MySQLDialect

      16:43:57,998 INFO  [TransactionFactoryFactory:59] Using default transaction strategy (direct JDBC transactions)

      16:43:58,005 INFO  [TransactionManagerLookupFactory:80] No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)

      16:43:58,006 INFO  [SettingsFactory:170] Automatic flush during beforeCompletion(): disabled

      16:43:58,007 INFO  [SettingsFactory:174] Automatic session close at end of transaction: disabled

      16:43:58,008 INFO  [SettingsFactory:181] JDBC batch size: 15

      16:43:58,008 INFO  [SettingsFactory:184] JDBC batch updates for versioned data: disabled

      16:43:58,011 INFO  [SettingsFactory:189] Scrollable result sets: enabled

      16:43:58,011 INFO  [SettingsFactory:197] JDBC3 getGeneratedKeys(): enabled

      16:43:58,012 INFO  [SettingsFactory:205] Connection release mode: auto

      16:43:58,014 INFO  [SettingsFactory:229] Maximum outer join fetch depth: 2

      16:43:58,015 INFO  [SettingsFactory:232] Default batch fetch size: 1

      16:43:58,015 INFO  [SettingsFactory:236] Generate SQL with comments: disabled

      16:43:58,016 INFO  [SettingsFactory:240] Order SQL updates by primary key: disabled

      16:43:58,018 INFO  [SettingsFactory:244] Order SQL inserts for batching: disabled

      16:43:58,018 INFO  [SettingsFactory:420] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory

      16:43:58,024 INFO  [ASTQueryTranslatorFactory:47] Using ASTQueryTranslatorFactory

      16:43:58,024 INFO  [SettingsFactory:252] Query language substitutions: {true=1, false=0}

      16:43:58,025 INFO  [SettingsFactory:257] JPA-QL strict compliance: disabled

      16:43:58,026 INFO  [SettingsFactory:262] Second-level cache: enabled

      16:43:58,026 INFO  [SettingsFactory:266] Query cache: disabled

      16:43:58,027 INFO  [SettingsFactory:405] Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory

      16:43:58,028 INFO  [SettingsFactory:276] Optimize cache for minimal puts: disabled

      16:43:58,029 INFO  [SettingsFactory:285] Structured second-level cache entries: disabled

      16:43:58,041 INFO  [SettingsFactory:305] Echoing all SQL to stdout

      16:43:58,046 INFO  [SettingsFactory:314] Statistics: disabled

      16:43:58,046 INFO  [SettingsFactory:318] Deleted entity synthetic identifier rollback: disabled

      16:43:58,047 INFO  [SettingsFactory:333] Default entity-mode: pojo

      16:43:58,048 INFO  [SettingsFactory:337] Named query checking : enabled

      16:43:58,094 INFO  [SessionFactoryImpl:187] building session factory

      16:43:59,221 INFO  [SessionFactoryObjectFactory:105] Not binding factory to JNDI, no JNDI name configured

      Hibernate: select propertyim0_.KEY_ as KEY1_2_, propertyim0_.VERSION_ as VERSION2_2_, propertyim0_.VALUE_ as VALUE3_2_ from JBPM4_PROPERTY propertyim0_ limit ?

      Hibernate: select this_.KEY_ as KEY1_2_0_, this_.VERSION_ as VERSION2_2_0_, this_.VALUE_ as VALUE3_2_0_ from JBPM4_PROPERTY this_ where this_.KEY_=?

      Hibernate: select this_.KEY_ as KEY1_2_0_, this_.VERSION_ as VERSION2_2_0_, this_.VALUE_ as VALUE3_2_0_ from JBPM4_PROPERTY this_ where this_.KEY_=?

      28 déc. 2009 16:44:00 org.jbpm.internal.log.Jdk14Log info

      INFO: jBPM version info: library[4.2], schema[4.2]

      16:44:00,416 INFO  [JBPMStartupEvent:41] [SEL] Loading missing process definitions :

      16:44:00,417 INFO  [JBPMStartupEvent:44] [SEL] Checking definition [re] ........

      Hibernate: select deployment1_.OBJNAME_ as col_0_0_, deployment1_.DEPLOYMENT_ as col_1_0_ from JBPM4_DEPLOYMENT deployment0_, JBPM4_DEPLOYPROP deployment1_, JBPM4_DEPLOYPROP deployment2_, JBPM4_DEPLOYPROP deployment3_ where deployment1_.KEY_='pdid' and deployment1_.DEPLOYMENT_=deployment0_.DBID_ and deployment2_.KEY_='pdkey' and deployment2_.OBJNAME_=deployment1_.OBJNAME_ and deployment2_.DEPLOYMENT_=deployment0_.DBID_ and deployment3_.KEY_='pdversion' and deployment3_.OBJNAME_=deployment1_.OBJNAME_ and deployment3_.DEPLOYMENT_=deployment0_.DBID_ and deployment2_.STRINGVAL_='re'

      16:44:00,554 INFO  [JBPMStartupEvent:49] [SEL] Definition [re] was not found, adding it.

      Hibernate: select propertyim0_.KEY_ as KEY1_2_, propertyim0_.VERSION_ as VERSION2_2_, propertyim0_.VALUE_ as VALUE3_2_ from JBPM4_PROPERTY propertyim0_ where propertyim0_.KEY_='next.dbid'

      Hibernate: update JBPM4_PROPERTY set VERSION_=?, VALUE_=? where KEY_=? and VERSION_=?

      Hibernate: select lob_.DBID_, lob_.DBVERSION_ as DBVERSION2_5_, lob_.BLOB_VALUE_ as BLOB3_5_ from JBPM4_LOB lob_ where lob_.DBID_=?

      Hibernate: insert into JBPM4_DEPLOYMENT (NAME_, TIMESTAMP_, STATE_, DBID_) values (?, ?, ?, ?)

      Hibernate: insert into JBPM4_LOB (DBVERSION_, BLOB_VALUE_, DBID_) values (?, ?, ?)

      Hibernate: insert into JBPM4_DEPLOYPROP (DEPLOYMENT_, OBJNAME_, KEY_, STRINGVAL_, LONGVAL_, DBID_) values (?, ?, ?, ?, ?, ?)

      Hibernate: update JBPM4_DEPLOYPROP set DEPLOYMENT_=?, OBJNAME_=?, KEY_=?, STRINGVAL_=?, LONGVAL_=? where DBID_=?

      Hibernate: update JBPM4_LOB set DEPLOYMENT_=?, NAME_=? where DBID_=?

      Hibernate: update JBPM4_DEPLOYPROP set DEPLOYMENT_=? where DBID_=?

      Hibernate: select deployment1_.OBJNAME_ as col_0_0_, deployment1_.DEPLOYMENT_ as col_1_0_ from JBPM4_DEPLOYMENT deployment0_, JBPM4_DEPLOYPROP deployment1_, JBPM4_DEPLOYPROP deployment2_, JBPM4_DEPLOYPROP deployment3_ where deployment1_.KEY_='pdid' and deployment1_.DEPLOYMENT_=deployment0_.DBID_ and deployment2_.KEY_='pdkey' and deployment2_.OBJNAME_=deployment1_.OBJNAME_ and deployment2_.DEPLOYMENT_=deployment0_.DBID_ and deployment3_.KEY_='pdversion' and deployment3_.OBJNAME_=deployment1_.OBJNAME_ and deployment3_.DEPLOYMENT_=deployment0_.DBID_ and deployment1_.OBJNAME_='Redaction'

      Hibernate: select deployment1_.OBJNAME_ as col_0_0_, deployment1_.DEPLOYMENT_ as col_1_0_ from JBPM4_DEPLOYMENT deployment0_, JBPM4_DEPLOYPROP deployment1_, JBPM4_DEPLOYPROP deployment2_, JBPM4_DEPLOYPROP deployment3_ where deployment1_.KEY_='pdid' and deployment1_.DEPLOYMENT_=deployment0_.DBID_ and deployment2_.KEY_='pdkey' and deployment2_.OBJNAME_=deployment1_.OBJNAME_ and deployment2_.DEPLOYMENT_=deployment0_.DBID_ and deployment3_.KEY_='pdversion' and deployment3_.OBJNAME_=deployment1_.OBJNAME_ and deployment3_.DEPLOYMENT_=deployment0_.DBID_ and deployment2_.STRINGVAL_='re'

      Hibernate: select deployment1_.OBJNAME_ as col_0_0_, deployment1_.DEPLOYMENT_ as col_1_0_ from JBPM4_DEPLOYMENT deployment0_, JBPM4_DEPLOYPROP deployment1_, JBPM4_DEPLOYPROP deployment2_, JBPM4_DEPLOYPROP deployment3_ where deployment1_.KEY_='pdid' and deployment1_.DEPLOYMENT_=deployment0_.DBID_ and deployment2_.KEY_='pdkey' and deployment2_.OBJNAME_=deployment1_.OBJNAME_ and deployment2_.DEPLOYMENT_=deployment0_.DBID_ and deployment3_.KEY_='pdversion' and deployment3_.OBJNAME_=deployment1_.OBJNAME_ and deployment3_.DEPLOYMENT_=deployment0_.DBID_ and deployment2_.STRINGVAL_='re' order by deployment3_.LONGVAL_ desc limit ?

      Hibernate: select deployment1_.OBJNAME_ as col_0_0_, deployment1_.DEPLOYMENT_ as col_1_0_ from JBPM4_DEPLOYMENT deployment0_, JBPM4_DEPLOYPROP deployment1_, JBPM4_DEPLOYPROP deployment2_, JBPM4_DEPLOYPROP deployment3_ where deployment1_.KEY_='pdid' and deployment1_.DEPLOYMENT_=deployment0_.DBID_ and deployment2_.KEY_='pdkey' and deployment2_.OBJNAME_=deployment1_.OBJNAME_ and deployment2_.DEPLOYMENT_=deployment0_.DBID_ and deployment3_.KEY_='pdversion' and deployment3_.OBJNAME_=deployment1_.OBJNAME_ and deployment3_.DEPLOYMENT_=deployment0_.DBID_ and deployment1_.STRINGVAL_='re-1'

      16:44:00,930 INFO  [JBPMStartupEvent:44] [SEL] Checking definition [reMaPu] ........

      Hibernate: insert into JBPM4_DEPLOYPROP (DEPLOYMENT_, OBJNAME_, KEY_, STRINGVAL_, LONGVAL_, DBID_) values (?, ?, ?, ?, ?, ?)

      Hibernate: insert into JBPM4_DEPLOYPROP (DEPLOYMENT_, OBJNAME_, KEY_, STRINGVAL_, LONGVAL_, DBID_) values (?, ?, ?, ?, ?, ?)

      Hibernate: insert into JBPM4_DEPLOYPROP (DEPLOYMENT_, OBJNAME_, KEY_, STRINGVAL_, LONGVAL_, DBID_) values (?, ?, ?, ?, ?, ?)

      Hibernate: update JBPM4_DEPLOYPROP set DEPLOYMENT_=?, OBJNAME_=?, KEY_=?, STRINGVAL_=?, LONGVAL_=? where DBID_=?

      Hibernate: update JBPM4_DEPLOYPROP set DEPLOYMENT_=?, OBJNAME_=?, KEY_=?, STRINGVAL_=?, LONGVAL_=? where DBID_=?

      Hibernate: update JBPM4_DEPLOYPROP set DEPLOYMENT_=?, OBJNAME_=?, KEY_=?, STRINGVAL_=?, LONGVAL_=? where DBID_=?

      Hibernate: update JBPM4_DEPLOYPROP set DEPLOYMENT_=? where DBID_=?

      Hibernate: update JBPM4_DEPLOYPROP set DEPLOYMENT_=? where DBID_=?

      Hibernate: update JBPM4_DEPLOYPROP set DEPLOYMENT_=? where DBID_=?

      Hibernate: select deployment1_.OBJNAME_ as col_0_0_, deployment1_.DEPLOYMENT_ as col_1_0_ from JBPM4_DEPLOYMENT deployment0_, JBPM4_DEPLOYPROP deployment1_, JBPM4_DEPLOYPROP deployment2_, JBPM4_DEPLOYPROP deployment3_ where deployment1_.KEY_='pdid' and deployment1_.DEPLOYMENT_=deployment0_.DBID_ and deployment2_.KEY_='pdkey' and deployment2_.OBJNAME_=deployment1_.OBJNAME_ and deployment2_.DEPLOYMENT_=deployment0_.DBID_ and deployment3_.KEY_='pdversion' and deployment3_.OBJNAME_=deployment1_.OBJNAME_ and deployment3_.DEPLOYMENT_=deployment0_.DBID_ and deployment2_.STRINGVAL_='reMaPu'

      16:44:00,970 INFO  [JBPMStartupEvent:49] [SEL] Definition [reMaPu] was not found, adding it.

       

       

      As you can see, there are hibernate requests (select, update, insert), but nothing is ever written in the database, all stays in JBPM cache.

       

      Any idea about what's going wrong ? I could post some more config files if needed.

       

       

       

      Thanks a lot.

      Regards.

        • 1. Re: JBPM won't save data in the database
          jbarrez

          The only data that jBPM caches is repository data (ie deployments, procdefs, rules, etc.).

           

          Please post your jbpm.cfg.xml and jbpm.hibernate.cfg.xml.

          • 2. Re: JBPM won't save data in the database

            Thanks for your answer.

             

            Here's my jbpm.cfg.xml

             

            <?xml version="1.0" encoding="UTF-8"?>
            <jbpm-configuration>
              <import resource="jbpm.default.cfg.xml" />
              <import resource="jbpm.businesscalendar.cfg.xml" />
              <import resource="jbpm.tx.hibernate.cfg.xml" />
              <import resource="jbpm.jpdl.cfg.xml" />
              <import resource="jbpm.identity.cfg.xml" />
            </jbpm-configuration>
            

             

             

            And here's my jbpm.hibernate.cfg.xml

             

            <?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.dialect">org.hibernate.dialect.MySQLDialect</property>
                  <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
                  <property name="hibernate.connection.url">jdbc:mysql://localhost/sel?useUnicode=true&amp;characterEncoding=UTF-8</property>
                  <property name="hibernate.connection.username">root</property>
                  <property name="hibernate.connection.password"></property>
                  <property name="hibernate.connection.autocommit">true</property>
                  <property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
                  <property name="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
            
                 <mapping resource="jbpm.repository.hbm.xml" />
                 <mapping resource="jbpm.execution.hbm.xml" />
                 <mapping resource="jbpm.history.hbm.xml" />
                 <mapping resource="jbpm.task.hbm.xml" />
                 <mapping resource="jbpm.identity.hbm.xml" />
            
              </session-factory>
            </hibernate-configuration>
            
            • 3. Re: JBPM won't save data in the database
              kukeltje
              You should at least use the InnoDB dialect and innodb tables. Otherwise other things might go wrong also.
              • 4. Re: JBPM won't save data in the database

                Thanks Ronald, I'll take a look. So far I have no visible problem (no exception, no error in any log, etc.) except the one I described.

                 

                I was able to make it work, but I have a weird behavior I can't understand.

                I added the following in my hibernate config file :

                 

                          <property name="hibernate.format_sql">true</property>
                          <property name="hibernate.hbm2ddl.auto">update</property>
                

                 

                After that, it started to work, with no other changes. I'm not sure how this can impact hibernate's behavior. As I am the only one working on this part, I 100% sure I did no other changes.

                 

                To explain the weird behavior, I need to explain what I'm doing. Here's my code :

                 

                          // Starts the JBPM engine
                          processEngine = Configuration.getProcessEngine();
                          // Loads the environment
                          ((EnvironmentFactory)processEngine).openEnvironment();
                
                          // Loads worflow definitions if they do not exist yet
                          String[] definitionKeys = StringUtil.split(PropsUtil.get(PropsKeys.WORKFLOW_DEF_KEYS), StringPool.COMMA);
                          logger.info("[SEL] Loading missing process definitions :");
                          for (String defKey : definitionKeys) {
                               logger.info("[SEL] Checking definition ["+defKey+"] ........");
                               List<ProcessDefinition> processDef = processEngine.getRepositoryService().createProcessDefinitionQuery().processDefinitionKey(defKey).list();
                               if (processDef == null || processDef.isEmpty()) {
                                    // Deploy the definition
                                    logger.info("[SEL] Definition ["+defKey+"] was not found, adding it.");
                                    processEngine.getRepositoryService().createDeployment().addResourceFromClasspath(WORKFLOW_DEF_DIR + defKey + WORKFLOW_DEF_EXT).deploy();
                               } else {
                                    logger.info("[SEL] Definition ["+defKey+"] exists. Nothing to do.");
                               }
                          }
                          logger.info("[SEL] Finished loading missing process definitions");
                

                 

                1. I load the engine with my local configuration
                2. I open the environment (I got that from the documentation, but I do not fully understand it yet)
                3. I iterate over some definition keys I get from a config file, and for each I deploy it if it doesn't exist yet in the system. Otherwise I do nothing.

                 

                Now almost all works excepts the last definition (I tried to change the order, and it's always the last one) is not saved into the database. Furthermore, If I look into the database, in the JBPM4_DEPLOYPROP table, I have 4 entries for each processDefinition, but only 1 (the langid) for the last one.

                 

                I also noticed that when I add the following

                 

                processEngine.getRepositoryService().createProcessDefinitionQuery().list();
                

                 

                after the loop, all is well saved into the database.

                 

                What I am doing wrong ?

                 

                Thanks.

                • 5. Re: JBPM won't save data in the database

                  Hi,

                   

                  and happy new year.

                   

                  I still got the same problem, I wasn't able to find a solution.

                   

                  I tried to switch to InnoDB, doing like this

                   

                  <property name="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property>
                  

                   

                  and nothing was persisted in the database at all (I still can see the sql commands on the console).

                   

                  Still no idea about this problem ?

                   

                  Thanks.

                  • 6. Re: JBPM won't save data in the database
                    kukeltje

                    Oh, switchin to InnoDB was surely not going to solve this.

                     

                    If nothing is saved, there probably is no commit. Setting auto-commit  to true only helps if the rest of your db config does not overrules this. If you use JTA and the datasource participates in a running transaction that is never committed, you will never see data in the database.

                    • 7. Re: JBPM won't save data in the database

                      Thanks.

                       

                      I figured out the solution a few minutes before you replied to me. Thanks for that anyway, I appreciate the help.

                       

                      In order to solve the problem, I had to remove the auto-commit as well as remove the following line (see my previous post for full code)

                                // Loads the environment
                                ((EnvironmentFactory)processEngine).openEnvironment();

                       

                      as it seems to be done automatically while deploying defintions.

                       

                      Have a good day.

                      • 8. Re: JBPM won't save data in the database
                        jbarrez
                        Indeed, you don't need to open the environment yourself (this is done for all the API calls that you can use on the services). Only when you start writing your own command service stack (advanced stuff!), then you need to manage the environments yourself.
                        1 of 1 people found this helpful
                        • 9. Re: JBPM won't save data in the database

                          Ok I understand now.

                           

                          Thanks for lighting that up.

                          • 10. Re: JBPM won't save data in the database

                            hey,

                             

                            I am having the same problem. I am using JBPM 3.2.3 and MySQL 5. Can you please help what should i do to fix this?

                             

                            Here is my jbpm.cfg.xml:

                             

                            <jbpm-configuration>

                             

                              <!--
                                The default configurations can be found in org/jbpm/default.jbpm.cfg.xml
                                Those configurations can be overwritten by putting this file called
                                jbpm.cfg.xml on the root of the classpath and put in the customized values.
                              -->
                               <jbpm-context>
                                    <service name='persistence'
                                             factory='org.jbpm.persistence.db.DbPersistenceServiceFactory' />
                               </jbpm-context>
                                    <string name='resource.hibernate.cfg.xml' value='hibernate.cfg.xml' />
                            </jbpm-configuration>

                             

                            Here is my hibernate.cfg.xml (some part):

                             

                            ?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>

                             

                                <!-- hibernate dialect -->
                                <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>

                             

                                <!-- JDBC connection properties (begin) -->
                                <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
                                <property name="hibernate.connection.url">jdbc:mysql://localhost/JBPM</property>
                                <property name="hibernate.connection.username">cygnet</property>
                                <property name="hibernate.connection.password">cygnet</property>
                                <!-- JDBC connection properties (end) -->

                             

                             

                             

                            Regards,

                            Sakthi

                            • 11. Re: JBPM won't save data in the database
                              kukeltje
                              Well, you can't exactely have the same problem since you use 3.x and the original poster used 4.x. Do you close the JbpmContext? That takes care of a commit. If you want to enlist in an existing transaction you have to configure that. See the docs.