[jboss-user] [jBPM] - where to set "update" in databaseschema
Thomas Colditz
do-not-reply at jboss.com
Wed Aug 14 06:45:13 EDT 2013
Thomas Colditz [https://community.jboss.org/people/fellowtom] created the discussion
"where to set "update" in databaseschema"
To view the discussion, visit: https://community.jboss.org/message/832618#832618
--------------------------------------------------------------
Hi Community,
I simply want to setup jBPM with embedded H2 database. It works, that it isn't an inmem db. But everytime the engine is startet again, all content of db is overwritten.
I think the problem is an "create"-statement somewhere, where an "update" should be inserted. But I just dont know where...
Here's sample code:
public static void main(String[] args) {
try {
RuntimeManager manager = getRuntimeManager("processDefinition/simpleTestProcess.bpmn");
RuntimeEngine runtime = manager.getRuntimeEngine(EmptyContext.get());
KieSession ksession = runtime.getKieSession();
ksession.startProcess("serviceTestProcess");
} catch (Throwable t) {
t.printStackTrace();
}
}
private static RuntimeManager getRuntimeManager(String process) {
JBPMHelper.startH2Server();
Properties properties = new Properties();
PoolingDataSource pds = new PoolingDataSource();
pds.setUniqueName(properties.getProperty("persistence.datasource.name", "jdbc/jbpm-ds"));
pds.setClassName("bitronix.tm.resource.jdbc.lrc.LrcXADataSource");
pds.setMaxPoolSize(5);
pds.setAllowLocalTransactions(true);
pds.getDriverProperties().put("user", properties.getProperty("persistence.datasource.user", "sa"));
pds.getDriverProperties().put("password", properties.getProperty("persistence.datasource.password", "sa"));
pds.getDriverProperties().put("url", properties.getProperty("persistence.datasource.url", "jdbc:h2:~/JBPM/process_jbpm;MVCC=TRUE"));
pds.getDriverProperties().put("driverClassName", properties.getProperty("persistence.datasource.driverClassName", "org.h2.Driver"));
pds.init();
RuntimeEnvironment environment = RuntimeEnvironmentBuilder.getDefault()
.addAsset(ResourceFactory.newClassPathResource(process), ResourceType.BPMN2)
.get();
return RuntimeManagerFactory.Factory.get().newSingletonRuntimeManager(environment);
}
Please let me know, where/how to fix the problem.
With kind regards,
Tom
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/832618#832618]
Start a new discussion in jBPM at Community
[https://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/20130814/08d2acba/attachment-0001.html
More information about the jboss-user
mailing list