jbpm 数据表被删除且被重新创建
jbpm 数据表被删除且被重新创建
怎么样可以不用删除表和里面的数据啊
[解决办法]
不懂什么意思
。。能否说的明白些
[解决办法]
我用的是MYSQL
1.
启动TOMCAT以后,会通过JBPM配置在数据库里面创建工作流的表!
我第一次启动的时候我要的表都创建了,我向里面插了数据;
但是第二次启动的时候JBPM会重新创建表,里面的数据库都没有了
所以我想问怎么避免第二次启动的时候不重新创建表。
2.
我又碰到了新的问题。
就是启动TOMCAT以后(第一次),JBPM创建表,并把我自己创建的一部分表
删除了,为什么?求助啊!~~~~~
[解决办法]
怎么可能呢。!我一样用mysql 一样用jbpm。一样tomcat。怎么就没出现你这样的事。
删除jbpm中的表的话。是能过JbpmConfiguration.DropSchema()业实现的。如果是启动时就删除的话那么。。查看你的配置文件。。看下是不是有类似的代码 在filter or server init方法中。
不调用 DropSchema是不可能去删除那些表的。
[解决办法]
没有你说的类似代码在filter or server init 方法中啊
我的hibernate配置文件如下:
<property name="hibernate.connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property name="hibernate.connection.url">
jdbc:mysql://127.0.0.1/oa8000
</property>
<property name="connection.characterEncoding">UTF-8</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">root</property>
<property name="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.cache.provider_class">
org.hibernate.cache.HashtableCacheProvider
</property>
<property name="hibernate.cache.use_second_level_cache">
false
</property>
<property name="hibernate.cache.use_query_cache">
false
</property>
<!--
<property name="connection.pool.size">3</property>
<property name="show_sql">true</property>
<property name="hibernate.cache.provider_class">
org.hibernate.cache.HashtableCacheProvider
</property>
<property name="hibernate.show_sql">true</property>
-->
<!-- ############################################ -->
<!-- # mapping files with external dependencies # -->
<!-- ############################################ -->
<!-- following mapping file has a dependendy on -->
<!-- 'bsh-{version}.jar'. -->
<!-- uncomment this if you don't have bsh on your -->
<!-- classpath. you won't be able to use the -->
<!-- script element in process definition files -->
<property name="myeclipse.connection.profile">sql</property>
<property name="connection.url">
jdbc:mysql://localhost:3306/oa8000
</property>
<property name="connection.username">root</property>
<property name="connection.password">root</property>
<property name="connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property name="dialect">
org.hibernate.dialect.MySQLDialect
</property>
<mapping resource="org/jbpm/graph/action/Script.hbm.xml" />
<!-- following mapping files have a dependendy on -->
<!-- 'jbpm-identity-{version}.jar', mapping files -->
<!-- of the pluggable jbpm identity component. -->
<!-- comment out the following 3 lines if you don't-->
<!-- want to use the default jBPM identity mgmgt -->
<!-- component -->
<mapping resource="org/jbpm/identity/User.hbm.xml" />
<mapping resource="org/jbpm/identity/Group.hbm.xml" />
<mapping resource="org/jbpm/identity/Membership.hbm.xml" />
<!-- ###################### -->
<!-- # jbpm mapping files # -->
<!-- ###################### -->
<!-- hql queries and type defs -->
<mapping resource="org/jbpm/db/hibernate.queries.hbm.xml" />
<!-- graph.def mapping files -->
<mapping
resource="org/jbpm/graph/def/ProcessDefinition.hbm.xml" />
<mapping resource="org/jbpm/graph/def/Node.hbm.xml" />
<mapping resource="org/jbpm/graph/def/Transition.hbm.xml" />
<mapping resource="org/jbpm/graph/def/Event.hbm.xml" />
<mapping resource="org/jbpm/graph/def/Action.hbm.xml" />
<mapping resource="org/jbpm/graph/def/SuperState.hbm.xml" />
<mapping resource="org/jbpm/graph/def/ExceptionHandler.hbm.xml" />
<mapping resource="org/jbpm/instantiation/Delegation.hbm.xml" />
<!-- graph.node mapping files -->
<mapping resource="org/jbpm/graph/node/StartState.hbm.xml" />
<mapping resource="org/jbpm/graph/node/EndState.hbm.xml" />
<mapping resource="org/jbpm/graph/node/ProcessState.hbm.xml" />
<mapping resource="org/jbpm/graph/node/Decision.hbm.xml" />
<mapping resource="org/jbpm/graph/node/Fork.hbm.xml" />
<mapping resource="org/jbpm/graph/node/Join.hbm.xml" />
<mapping resource="org/jbpm/graph/node/State.hbm.xml" />
<mapping resource="org/jbpm/graph/node/TaskNode.hbm.xml" />
<!-- context.def mapping files -->
<mapping
resource="org/jbpm/context/def/ContextDefinition.hbm.xml" />
<mapping resource="org/jbpm/context/def/VariableAccess.hbm.xml" />
<!-- taskmgmt.def mapping files -->
<mapping
resource="org/jbpm/taskmgmt/def/TaskMgmtDefinition.hbm.xml" />
<mapping resource="org/jbpm/taskmgmt/def/Swimlane.hbm.xml" />
<mapping resource="org/jbpm/taskmgmt/def/Task.hbm.xml" />
<mapping
resource="org/jbpm/taskmgmt/def/TaskController.hbm.xml" />
<!-- module.def mapping files -->
<mapping
resource="org/jbpm/module/def/ModuleDefinition.hbm.xml" />
<!-- bytes mapping files -->
<mapping resource="org/jbpm/bytes/ByteArray.hbm.xml" />
<!-- file.def mapping files -->
<mapping resource="org/jbpm/file/def/FileDefinition.hbm.xml" />
<!-- scheduler.def mapping files -->
<mapping
resource="org/jbpm/scheduler/def/CreateTimerAction.hbm.xml" />
<mapping
resource="org/jbpm/scheduler/def/CancelTimerAction.hbm.xml" />
<!-- graph.exe mapping files -->
<mapping resource="org/jbpm/graph/exe/Comment.hbm.xml" />
<mapping resource="org/jbpm/graph/exe/ProcessInstance.hbm.xml" />
<mapping resource="org/jbpm/graph/exe/Token.hbm.xml" />
<mapping resource="org/jbpm/graph/exe/RuntimeAction.hbm.xml" />
<!-- module.exe mapping files -->
<mapping resource="org/jbpm/module/exe/ModuleInstance.hbm.xml" />
<!-- context.exe mapping files -->
<mapping
resource="org/jbpm/context/exe/ContextInstance.hbm.xml" />
<mapping
resource="org/jbpm/context/exe/TokenVariableMap.hbm.xml" />
<mapping
resource="org/jbpm/context/exe/VariableInstance.hbm.xml" />
<mapping
resource="org/jbpm/context/exe/variableinstance/ByteArrayInstance.hbm.xml" />
<mapping
resource="org/jbpm/context/exe/variableinstance/DateInstance.hbm.xml" />
<mapping
resource="org/jbpm/context/exe/variableinstance/DoubleInstance.hbm.xml" />
<mapping
resource="org/jbpm/context/exe/variableinstance/HibernateLongInstance.hbm.xml" />
<mapping
resource="org/jbpm/context/exe/variableinstance/HibernateStringInstance.hbm.xml" />
<mapping
resource="org/jbpm/context/exe/variableinstance/LongInstance.hbm.xml" />
<mapping
resource="org/jbpm/context/exe/variableinstance/NullInstance.hbm.xml" />
<mapping
resource="org/jbpm/context/exe/variableinstance/StringInstance.hbm.xml" />
<!-- msg.db mapping files -->
<mapping resource="org/jbpm/msg/Message.hbm.xml" />
<mapping resource="org/jbpm/msg/db/TextMessage.hbm.xml" />
<mapping
resource="org/jbpm/command/ExecuteActionCommand.hbm.xml" />
<mapping resource="org/jbpm/command/ExecuteNodeCommand.hbm.xml" />
<mapping resource="org/jbpm/command/SignalCommand.hbm.xml" />
<mapping
resource="org/jbpm/command/TaskInstanceEndCommand.hbm.xml" />
<!-- taskmgmt.exe mapping files -->
<mapping
resource="org/jbpm/taskmgmt/exe/TaskMgmtInstance.hbm.xml" />
<mapping resource="org/jbpm/taskmgmt/exe/TaskInstance.hbm.xml" />
<mapping resource="org/jbpm/taskmgmt/exe/PooledActor.hbm.xml" />
<mapping
resource="org/jbpm/taskmgmt/exe/SwimlaneInstance.hbm.xml" />
<!-- scheduler.exe mapping files -->
<mapping resource="org/jbpm/scheduler/exe/Timer.hbm.xml" />
<!-- logging mapping files -->
<mapping resource="org/jbpm/logging/log/ProcessLog.hbm.xml" />
<mapping resource="org/jbpm/logging/log/MessageLog.hbm.xml" />
<mapping resource="org/jbpm/logging/log/CompositeLog.hbm.xml" />
<mapping resource="org/jbpm/graph/log/ActionLog.hbm.xml" />
<mapping resource="org/jbpm/graph/log/NodeLog.hbm.xml" />
<mapping
resource="org/jbpm/graph/log/ProcessInstanceCreateLog.hbm.xml" />
<mapping
resource="org/jbpm/graph/log/ProcessInstanceEndLog.hbm.xml" />
<mapping resource="org/jbpm/graph/log/ProcessStateLog.hbm.xml" />
<mapping resource="org/jbpm/graph/log/SignalLog.hbm.xml" />
<mapping resource="org/jbpm/graph/log/TokenCreateLog.hbm.xml" />
<mapping resource="org/jbpm/graph/log/TokenEndLog.hbm.xml" />
<mapping resource="org/jbpm/graph/log/TransitionLog.hbm.xml" />
<mapping resource="org/jbpm/context/log/VariableLog.hbm.xml" />
<mapping
resource="org/jbpm/context/log/VariableCreateLog.hbm.xml" />
<mapping
resource="org/jbpm/context/log/VariableDeleteLog.hbm.xml" />
<mapping
resource="org/jbpm/context/log/VariableUpdateLog.hbm.xml" />
<mapping
resource="org/jbpm/context/log/variableinstance/ByteArrayUpdateLog.hbm.xml" />
<mapping
resource="org/jbpm/context/log/variableinstance/DateUpdateLog.hbm.xml" />
<mapping
resource="org/jbpm/context/log/variableinstance/DoubleUpdateLog.hbm.xml" />
<mapping
resource="org/jbpm/context/log/variableinstance/HibernateLongUpdateLog.hbm.xml" />
<mapping
resource="org/jbpm/context/log/variableinstance/HibernateStringUpdateLog.hbm.xml" />
<mapping
resource="org/jbpm/context/log/variableinstance/LongUpdateLog.hbm.xml" />
<mapping
resource="org/jbpm/context/log/variableinstance/StringUpdateLog.hbm.xml" />
<mapping resource="org/jbpm/taskmgmt/log/TaskLog.hbm.xml" />
<mapping resource="org/jbpm/taskmgmt/log/TaskCreateLog.hbm.xml" />
<mapping resource="org/jbpm/taskmgmt/log/TaskAssignLog.hbm.xml" />
<mapping resource="org/jbpm/taskmgmt/log/TaskEndLog.hbm.xml" />
<mapping resource="org/jbpm/taskmgmt/log/SwimlaneLog.hbm.xml" />
<mapping
resource="org/jbpm/taskmgmt/log/SwimlaneCreateLog.hbm.xml" />
<mapping
resource="org/jbpm/taskmgmt/log/SwimlaneAssignLog.hbm.xml" />
[解决办法]
下面的是JBPM.cfg.xml的配置
<jbpm-configuration>
<jbpm-context>
<service name="persistence" factory="org.jbpm.persistence.db.DbPersistenceServiceFactory">
<factory>
<bean class="org.jbpm.persistence.db.DbPersistenceServiceFactory">
<field name="isTransactionEnabled"><false/></field>
<field name="isCurrentSessionEnabled"><true/></field>
</bean>
</factory>
</service>
<service name="message" factory="org.jbpm.msg.db.DbMessageServiceFactory" />
<service name="scheduler" factory="org.jbpm.scheduler.db.DbSchedulerServiceFactory" />
<service name="logging" factory="org.jbpm.logging.db.DbLoggingServiceFactory" />
<service name="authentication" factory="org.jbpm.security.authentication.DefaultAuthenticationServiceFactory" />
</jbpm-context>
<!-- configuration resource files pointing to default configuration files in jbpm-{version}.jar -->
<!--<string name="resource.hibernate.cfg.xml" value="hibernate.cfg.xml" /> -->
<string name="resource.business.calendar" value="org/jbpm/calendar/jbpm.business.calendar.properties" />
<string name="resource.default.modules" value="org/jbpm/graph/def/jbpm.default.modules.properties" />
<string name="resource.converter" value="org/jbpm/db/hibernate/jbpm.converter.properties" />
<string name="resource.action.types" value="org/jbpm/graph/action/action.types.xml" />
<string name="resource.node.types" value="org/jbpm/graph/node/node.types.xml" />
<string name="resource.parsers" value="org/jbpm/jpdl/par/jbpm.parsers.xml" />
<string name="resource.varmapping" value="org/jbpm/context/exe/jbpm.varmapping.xml" />
<long name="jbpm.msg.wait.timout" value="5000" singleton="true" />
<int name="jbpm.byte.block.size" value="1024" singleton="true" />
<string name="mail.smtp.host" value="localhost" />
<bean name="jbpm.task.instance.factory" class="org.jbpm.taskmgmt.impl.DefaultTaskInstanceFactoryImpl" singleton="true" />
<bean name="jbpm.variable.resolver" class="org.jbpm.jpdl.el.impl.JbpmVariableResolver" singleton="true" />
<bean name="jbpm.mail.address.resolver" class="org.jbpm.identity.mail.IdentityAddressResolver" singleton="true" />
</jbpm-configuration>
[解决办法]
你可以只设置为更新啊,配置有问题,我忘记了,应该是hibernate里面的配置
按照你的情况,应该是编译时Hibernate重新生成了一次表
好好看看配置文件,很简单的