[JCA] - Time spent in org.jboss.resource.adapter.jdbc (locking issue
by naeger
Hi all,
I am currently profiling an app deployed on a JBoss 4.2.3 with an underlying MySQL database.
Basically all stack traces where time is spent boil down to the following:
-> our stuff
--> some Hibernate method time spent so far: 1%
----> org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery() time spent in this method: 95%
-------> net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery() time spent in this method: 4%
The interesting thing now is that 95% of the time is spent in WrappedPreparedStatement, BUT ONLY 4% in JtdsPreparedStatement.executeQuery().
So it looks as if 95% of the time is spent inside Jboss and only 4% in the actual query to the database!!!
This also complies with the observation that our application is terribly slow, but the database load is still quite low.
My profiler does not profile into Jboss, so I debugged into org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery() to see where this time could have been spent and I have the suspicion it is in the synchronized(stateLock) block of the following method (called from WrappedPreparedStatement.executeQuery()):
org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.checkTransaction()
Does anyone have an idea what we might be doing wrong? Or what causes this strange behaviour?
Any help is highly appreciated!
Regards,
Christian Naeger
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4264070#4264070
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4264070
16 years, 5 months
[Performance Tuning] - Time spent in WrappedPreparedStatement but not in actual dat
by naeger
Hi all,
I am currently profiling an app deployed on a JBoss 4.2.3 with an underlying MySQL database.
Basically all stack traces where time is spent boil down to the following:
-> our stuff
--> some Hibernate method time spent so far: 1%
----> org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery() time spent in this method: 95%
-------> net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery() time spent in this method: 4%
The interesting thing now is that 95% of the time is spent in WrappedPreparedStatement, BUT ONLY 4% in JtdsPreparedStatement.executeQuery().
So it looks as if 95% of the time is spent inside Jboss and only 4% in the actual query to the database!!!
This also complies with the observation that our application is terribly slow, but the database load is still quite low.
My profiler does not profile into Jboss, so I debugged into org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery() to see where this time could have been spent and I have the suspicion it is in the synchronized(stateLock) block of the following method (called from WrappedPreparedStatement.executeQuery()):
org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.checkTransaction()
Does anyone have an idea what we might be doing wrong? Or what causes this strange behaviour?
Any help is highly appreciated!
Regards,
Christian Naeger
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4264069#4264069
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4264069
16 years, 5 months
[Persistence] - Time spent in WrappedPreparedStatement but not in actual dat
by naeger
Hi all,
I am currently profiling an app deployed on a JBoss 4.2.3 with an underlying MySQL database.
Basically all stack traces where time is spent boil down to the following:
-> our stuff
--> some Hibernate method time spent so far: 1%
----> org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery() time spent in this method: 95%
-------> net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery() time spent in this method: 4%
The interesting thing now is that 95% of the time is spent in WrappedPreparedStatement, BUT ONLY 4% in JtdsPreparedStatement.executeQuery().
So it looks as if 95% of the time is spent inside Jboss and only 4% in the actual query to the database!!!
This also complies with the observation that our application is terribly slow, but the database load is still quite low.
My profiler does not profile into Jboss, so I debugged into org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery() to see where this time could have been spent and I have the suspicion it is in the synchronized(stateLock) block of the following method (called from WrappedPreparedStatement.executeQuery()):
org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.checkTransaction()
Does anyone have an idea what we might be doing wrong? Or what causes this strange behaviour?
Any help is highly appreciated!
Regards,
Christian Naeger
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4264068#4264068
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4264068
16 years, 5 months
[jBPM Users] - How to model Rework senario in JBPM
by pradeep.gulla
I've created a workflow process, but I'm unable to proceed further.
Requirement:
1) Assign Parallel Tasks
2) Approval flow should go next level if all tasks gets completed
(or)
A new task should be created if any of one parallel approver initiate rework
Process Definition:
| <start><transition to="initiate-all-tasks"/></start>
| <fork name="initiate-all-tasks"><transition to="parallel1"/><transition to="parallel2"/></fork>
| <task name="parallel1">
| <transition name="approve" to="join"/><transition name="rework" to="inactivate-tasks"/>
| </task>
| <task name="parallel2">
| <transition name="approve" to="join"/><transition name="rework" to="inactivate-tasks"/>
| </task>
| <join name="join">
| <transition to="another-task"/>
| </join>
| <custom name="inactivate-tasks"><transition to="rework-task"/></custom>
| <task name="rework-task"><transition to="initiate-all-tasks"/></task>
| <task name="another-task">
| ..................
|
As far as approval process everything is working fine.
But i'm stuck with Rework flow at Custom Node. Any suggestions ??
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4264066#4264066
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4264066
16 years, 5 months
[JBoss Cache Users] - MVCC leading to deadlocks in synchronous replication mode
by vsevel
Hi,
I have an application where there is a high probability that 2 or more client calls will hit my server asking for a data that is not known from the cache running on this server. In that case, the server calculates the data (eg: it fetches from the db), puts it in the cache then returns it: simple standard use case.
The application is deployed on a cluster of 2 two nodes. clients get load balanced, so there is a high probability that client calls, asking for the same data at the same time, do not all land onto the same server.
Finally, I want to make sure that when the data is in the cache, it is in the other node as well. That is the reason why I decided to use synchronous replication.
As far as locking is concerned, I first tried with the PESSIMISTIC mode. I ended up with lots of deadlocks where 2 clients would land on 2 differents nodes, get each a local lock, then finally deadlock each other at commit time. On a simple stress test case, I was able to make fail most (almost all) of the client calls.
I switched to OPTIMISTIC, and the situation improved. in the same stress the failure ratio went from 95% with PESSIMISTIC to 5 to 10%, with no deadlocks at all (all calls returned in less than 200ms).
Finally, I decided to give MVCC a try. to my surprise, I found that the behavior I was getting was almost identical to the one with PESSIMISTIC. I linked that to the fact that writers immediately take a lock locally, and will take a remote lock at commit time only.
This leads me to 2 reflections:
- Am I missing something obvious in either my configuration or my code? (I am attaching the jboss cache config and java code)
- If this behavior is expected, and since OPTIMISTIC and PESSIMISTIC are supposed to be removed from the code base at some time, what is then the solution for users that cannot afford those deadlocks?
Thanks,
Here is the configuration:
mvcc_treecache-cfg.xml:
| <?xml version="1.0" encoding="UTF-8"?>
| <jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.1">
| <locking nodeLockingScheme="MVCC" isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="10000" lockParentForChildInsertRemove="false" />
| <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup" />
| <clustering mode="replication" clusterName="mvcc_domain_TreeCache_VSE">
| <sync replTimeout="10000" />
| <stateRetrieval fetchInMemoryState="false" timeout="10000" />
| <jgroupsConfig configFile="jbosscache_pessimistic/mvcc_treecache-cfg-jgroupsConfig.xml" />
| </clustering>
| <eviction wakeUpInterval="3000">
| <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm">
| <property name="maxNodes" value="5000" />
| <property name="timeToLive" value="-1" />
| </default>
| <region name="/myregion" algorithmClass="org.jboss.cache.eviction.LRUAlgorithm" eventQueueSize="">
| <property name="maxNodes" value="1000" />
| <property name="timeToLive" value="-1" />
| </region>
| <region name="/myregion/Users" algorithmClass="org.jboss.cache.eviction.LRUAlgorithm" eventQueueSize="">
| <property name="maxNodes" value="0" />
| <property name="timeToLive" value="172800000" />
| </region>
| </eviction>
| </jbosscache>
|
mvcc_treecache-cfg-jgroupsConfig.xml:
| <config>
| <UDP mcast_addr="239.202.87.15" mcast_port="11001" ip_ttl="64"
| ip_mcast="true" mcast_send_buf_size="150000" mcast_recv_buf_size="80000"
| ucast_send_buf_size="150000" ucast_recv_buf_size="80000"
| bind_addr="${jbosscache_bind_addr}" loopback="true" />
| <PING timeout="10000" num_initial_members="3" />
| <MERGE2 min_interval="10000" max_interval="20000" />
| <FD_SOCK />
| <VERIFY_SUSPECT timeout="1500" />
| <pbcast.NAKACK gc_lag="50" retransmit_timeout="600,1200,2400,4800" />
| <UNICAST timeout="600,1200,2400,4800" />
| <pbcast.STABLE desired_avg_gossip="40000" />
| <FRAG frag_size="8192" />
| <pbcast.GMS join_timeout="5000" shun="true"
| print_local_addr="true" />
| <pbcast.STATE_TRANSFER />
| </config>
|
Here is the stateless session bean impl:
| public class TestBean implements SessionBean {
|
| private static final Logger log = Logger.getLogger(TestBean.class);
|
| private static final long serialVersionUID = -1934030976428012964L;
|
| private static Map<String, Cache<String, String>> cacheMap = new HashMap<String, Cache<String, String>>();
|
| private SessionContext sessionContext;
|
| public static Object lookup(String jndi, String url) throws NamingException {
| Properties properties = new Properties();
| properties.put(INITIAL_CONTEXT_FACTORY, WLInitialContextFactory.class.getName());
| properties.put(PROVIDER_URL, url);
| properties.put(ALLOW_GLOBAL_RESOURCE_LOOKUP, "true");
| properties.put(ALLOW_EXTERNAL_APP_LOOKUP, "true");
| properties.put(RELAX_VERSION_LOOKUP, "true");
| return new InitialContext(properties).lookup(jndi);
| }
|
| static synchronized Cache<String, String> getCache(String cacheName) {
| try {
| Cache<String, String> cache = cacheMap.get(cacheName);
| if (cache != null) return cache;
| log.info("initializing cache " + cacheName);
| DefaultCacheFactory<String, String> factory = new DefaultCacheFactory<String, String>();
| cache = factory.createCache("jbosscache_pessimistic/" + cacheName + "_treecache-cfg.xml");
| cacheMap.put(cacheName, cache);
| log.info("initialized cache " + cacheName);
| return cache;
| } catch (Exception e) {
| log.error(cacheName + " init error", e);
| throw new RuntimeException(e.toString(), e);
| }
| }
|
| static synchronized void closeCaches() {
| for (Map.Entry<String, Cache<String, String>> entry : cacheMap.entrySet()) {
| String cacheName = entry.getKey();
| try {
| log.info("closing cache " + cacheName);
| Cache<String, String> cache = entry.getValue();
| cache.stop();
| cache.destroy();
| } catch (Exception e) {
| log.error("unable to close cache " + cacheName, e);
| }
| }
| }
|
| public String test(String cacheKey, String cacheValue, String cacheName, long waittime) throws InterruptedException {
| log.debug("attempting to get user " + cacheKey);
| Cache<String, String> cache = getCache(cacheName);
| Fqn<String> userFQN = Fqn.fromString("/myregion/Users/" + cacheKey);
|
| if (cacheValue == null) {
| log.debug("removing node " + userFQN);
| cache.removeNode(userFQN);
| log.debug("removed node " + userFQN);
| return null;
| }
|
| Node<String, String> user = cache.getNode(userFQN);
|
| if (user == null) {
| log.debug("missing cached " + cacheKey + " => caching " + cacheKey + "=" + cacheValue);
| user = cache.getRoot().addChild(userFQN);
| if(waittime > 0) Thread.sleep(waittime);
| user.put("value", cacheValue);
| return cacheValue;
| } else {
| String value = user.get("value");
| log.debug("return cached " + cacheKey + "=" + value + "; ignoring passed value: " + cacheValue);
| return value;
| }
| }
|
And finally, the stress test client:
| public class TestSystem {
|
| private static final Logger log = Logger.getLogger(TestSystem.class);
|
| @Test
| public void testServer() throws Exception {
| TestRemote ejb = createService();
| log.info("calling test ejb");
| ejb.test("myuser3", "toto", "optimistic", 0);
| ejb.remove();
| log.info("done");
| }
|
| @Test
| public void mt() throws Exception {
|
| // final String cacheName = "pessimistic";
| final String cacheName = "optimistic";
| // final String cacheName = "mvcc";
| final int count = 10000;
| int threads = 2;
| final String user = "myuser";
| final boolean stopOnFirstError = false;
| final long waittime = 0;
|
| Assert.assertNull(createService().test(user, null, cacheName, 0));
| Assert.assertEquals("warm up", createService().test(user, "warm up", cacheName, 0));
| Assert.assertNull(createService().test(user, null, cacheName, 0));
|
| log.info("warm up ok");
| Thread.sleep(5000);
| log.info("starting test");
| Thread.sleep(1000);
|
| final List<String> success = Collections.synchronizedList(new ArrayList<String>());
| final List<String> errors = Collections.synchronizedList(new ArrayList<String>());
| final List<Long> responseTime = Collections.synchronizedList(new ArrayList<Long>());
|
| for (int i = 0; i < threads; i++) {
| final int id = i;
|
| new Thread() {
| @Override
| public void run() {
| for (int j = 0; j < count; j++) {
| try {
| if (stopOnFirstError && !errors.isEmpty()) return;
| long start = System.currentTimeMillis();
| String result = createService().test(user, "toto from " + id, cacheName, waittime);
| long time = System.currentTimeMillis() - start;
| responseTime.add(time);
| success.add(result);
| if (time > 1000) log.debug("thread " + id + " test " + j + ": executed in " + time);
| // log.debug("thread " + id + " test " + j + ": " + result);
| } catch (Exception e) {
| String s = TestSystem.toString(e);
| log.debug("thread " + id + " test " + j + ": " + s);
| errors.add(s);
| }
| }
| }
| }.start();
| }
|
| int size = 0;
|
| while ((size = success.size() + errors.size()) != count * threads && !(stopOnFirstError && !errors.isEmpty())) {
| try {
| createService().test(user, null, cacheName, 0);
| if (size % 100 == 0) log.debug("tests executed so far: " + size);
| Thread.sleep(200);
| } catch (Exception e) {
| log.error("unable to remove user: " + toString(e));
| }
| }
|
| Collections.sort(responseTime);
| Long maxTime = responseTime.get(responseTime.size() - 1);
| log.info("done: success=" + success.size() + "; error=" + errors.size() + "; max time=" + maxTime);
| }
|
| static String toString(Exception e) {
| Throwable ex = e;
| while (ex.getCause() != null && ex.getCause() != ex)
| ex = ex.getCause();
| return firstLine(ex.toString()) + "(original=" + firstLine(e.toString()) + ")";
| }
|
| static String firstLine(String s) {
| int index = s.indexOf('\n');
| return index == -1 ? s : s.substring(0, index - 1);
| }
|
| private TestRemote createService() throws NamingException, RemoteException, CreateException {
| // String url = "t3://localhost:7001,localhost:8001";
| String jndi = "com.lodh.bank.ejb.TestRemoteHome";
|
| Object home = TestBean.lookup(jndi, url);
| TestRemoteHome h = (TestRemoteHome) PortableRemoteObject.narrow(home, TestRemoteHome.class);
| return h.create();
| }
| }
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4264064#4264064
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4264064
16 years, 5 months
[jBPM Users] - Configure another scripting language
by Eazyjd
Hello
I would like to configure another scripting language the JUEL for JBPM 4.1.
In the Userguide, you can read:
anonymous wrote : To configure other scripting languages then jUEL, please refer to the developer's guide (non supported).
But in the dev-guide, I can not find any information of how to do it.
Nevertheless, I did some "research" inside the JBPM jar(s) and found in the default config file (jbpm.default.cfg.xml) the following lines:
anonymous wrote : <script-manager default-expression-language="juel"
| default-script-language="juel">
| <script-language name="juel" factory="org.jbpm.pvm.internal.script.JuelScriptEngineFactory" />
| </script-manager>
What would be the process to add another JSR-223 compliant scripting engine to JBPM 4.1?
Thanks in adv. for your help
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4264059#4264059
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4264059
16 years, 5 months
[jBPM Users] - Re: JBPM 4.0 on DB2
by Eazyjd
Even though this topic is an older one, I just got JBPM 4.1 running on Apache Derby DB2 - after some troubles with data types and mappings on hibernate. I created a corresponding db-setup sql script.
create table JBPM4_DEPLOYMENT (
| DBID_ bigint generated by default as identity (start with 1, increment by 1),
| NAME_ clob,
| TIMESTAMP_ bigint,
| STATE_ varchar(255),
| primary key (DBID_)
| );
|
| create table JBPM4_DEPLOYPROP (
| DBID_ bigint generated by default as identity (start with 1, increment by 1),
| DEPLOYMENT_ bigint,
| OBJNAME_ varchar(255),
| KEY_ varchar(255),
| STRINGVAL_ varchar(255),
| LONGVAL_ bigint,
| primary key (DBID_)
| );
|
| create table JBPM4_EXECUTION (
| DBID_ bigint generated by default as identity (start with 1, increment by 1),
| CLASS_ varchar(255) not null,
| DBVERSION_ integer not null,
| ACTIVITYNAME_ varchar(255),
| PROCDEFID_ varchar(255),
| HASVARS_ char(1),
| NAME_ varchar(255),
| KEY_ varchar(255),
| ID_ varchar(255),
| STATE_ varchar(255),
| SUSPHISTSTATE_ varchar(255),
| PRIORITY_ integer,
| HISACTINST_ bigint,
| PARENT_ bigint,
| INSTANCE_ bigint,
| SUPEREXEC_ bigint,
| SUBPROCINST_ bigint,
| PARENT_IDX_ integer,
| primary key (DBID_),
| unique (ID_)
| );
|
| create table JBPM4_HIST_ACTINST (
| DBID_ bigint generated by default as identity (start with 1, increment by 1),
| CLASS_ varchar(255) not null,
| DBVERSION_ integer not null,
| HPROCI_ bigint,
| TYPE_ varchar(255),
| EXECUTION_ varchar(255),
| ACTIVITY_NAME_ varchar(255),
| START_ timestamp,
| END_ timestamp,
| DURATION_ bigint,
| TRANSITION_ varchar(255),
| NEXTIDX_ integer,
| HTASK_ bigint,
| primary key (DBID_)
| );
|
| create table JBPM4_HIST_DETAIL (
| DBID_ bigint generated by default as identity (start with 1, increment by 1),
| CLASS_ varchar(255) not null,
| DBVERSION_ integer not null,
| USERID_ varchar(255),
| TIME_ timestamp,
| HPROCI_ bigint,
| HPROCIIDX_ integer,
| HACTI_ bigint,
| HACTIIDX_ integer,
| HTASK_ bigint,
| HTASKIDX_ integer,
| HVAR_ bigint,
| HVARIDX_ integer,
| MESSAGE_ clob,
| OLD_INT_ integer,
| NEW_INT_ integer,
| OLD_STR_ varchar(255),
| NEW_STR_ varchar(255),
| OLD_TIME_ timestamp,
| NEW_TIME_ timestamp,
| PARENT_ bigint,
| PARENT_IDX_ integer,
| primary key (DBID_)
| );
|
| create table JBPM4_HIST_PROCINST (
| DBID_ bigint not null,
| DBVERSION_ integer not null,
| ID_ varchar(255),
| PROCDEFID_ varchar(255),
| KEY_ varchar(255),
| START_ timestamp,
| END_ timestamp,
| DURATION_ bigint,
| STATE_ varchar(255),
| ENDACTIVITY_ varchar(255),
| NEXTIDX_ integer,
| primary key (DBID_)
| );
|
| create table JBPM4_HIST_TASK (
| DBID_ bigint not null,
| DBVERSION_ integer not null,
| EXECUTION_ varchar(255),
| OUTCOME_ varchar(255),
| ASSIGNEE_ varchar(255),
| PRIORITY_ integer,
| STATE_ varchar(255),
| CREATE_ timestamp,
| END_ timestamp,
| DURATION_ bigint,
| NEXTIDX_ integer,
| SUPERTASK_ bigint,
| primary key (DBID_)
| );
|
| create table JBPM4_HIST_VAR (
| DBID_ bigint not null,
| DBVERSION_ integer not null,
| PROCINSTID_ varchar(255),
| EXECUTIONID_ varchar(255),
| VARNAME_ varchar(255),
| VALUE_ varchar(255),
| HPROCI_ bigint,
| HTASK_ bigint,
| primary key (DBID_)
| );
|
| create table JBPM4_ID_GROUP (
| DBID_ bigint generated by default as identity (start with 1, increment by 1),
| DBVERSION_ integer not null,
| ID_ varchar(255),
| NAME_ varchar(255),
| TYPE_ varchar(255),
| PARENT_ bigint,
| primary key (DBID_)
| );
|
| create table JBPM4_ID_MEMBERSHIP (
| DBID_ bigint generated by default as identity (start with 1, increment by 1),
| DBVERSION_ integer not null,
| USER_ bigint,
| GROUP_ bigint,
| NAME_ varchar(255),
| primary key (DBID_)
| );
|
| create table JBPM4_ID_USER (
| DBID_ bigint generated by default as identity (start with 1, increment by 1),
| DBVERSION_ integer not null,
| ID_ varchar(255),
| PASSWORD_ varchar(255),
| GIVENNAME_ varchar(255),
| FAMILYNAME_ varchar(255),
| BUSINESSEMAIL_ varchar(255),
| primary key (DBID_)
| );
|
| create table JBPM4_JOB (
| DBID_ bigint generated by default as identity (start with 1, increment by 1),
| CLASS_ varchar(255) not null,
| DBVERSION_ integer not null,
| DUEDATE_ timestamp,
| STATE_ varchar(255),
| ISEXCLUSIVE_ char(1),
| LOCKOWNER_ varchar(255),
| LOCKEXPTIME_ timestamp,
| EXCEPTION_ long varchar,
| RETRIES_ integer,
| PROCESSINSTANCE_ bigint,
| EXECUTION_ bigint,
| CFG_ bigint,
| SIGNAL_ varchar(255),
| EVENT_ varchar(255),
| REPEAT_ varchar(255),
| primary key (DBID_)
| );
|
| create table JBPM4_LOB (
| DBID_ bigint generated by default as identity (start with 1, increment by 1),
| DBVERSION_ integer not null,
| BLOB_VALUE_ blob,
| DEPLOYMENT_ bigint,
| NAME_ clob,
| primary key (DBID_)
| );
|
| create table JBPM4_PARTICIPATION (
| DBID_ bigint generated by default as identity (start with 1, increment by 1),
| DBVERSION_ integer not null,
| GROUPID_ varchar(255),
| USERID_ varchar(255),
| TYPE_ varchar(255),
| TASK_ bigint,
| SWIMLANE_ bigint,
| primary key (DBID_)
| );
|
| create table JBPM4_SWIMLANE (
| DBID_ bigint generated by default as identity (start with 1, increment by 1),
| DBVERSION_ integer not null,
| NAME_ varchar(255),
| ASSIGNEE_ varchar(255),
| EXECUTION_ bigint,
| primary key (DBID_)
| );
|
| create table JBPM4_TASK (
| DBID_ bigint generated by default as identity (start with 1, increment by 1),
| CLASS_ char(1) not null,
| DBVERSION_ integer not null,
| NAME_ varchar(255),
| DESCR_ clob,
| STATE_ varchar(255),
| SUSPHISTSTATE_ varchar(255),
| ASSIGNEE_ varchar(255),
| FORM_ varchar(255),
| PRIORITY_ integer,
| CREATE_ timestamp,
| DUEDATE_ timestamp,
| PROGRESS_ integer,
| SIGNALLING_ char(1),
| EXECUTION_ID_ varchar(255),
| ACTIVITY_NAME_ varchar(255),
| HASVARS_ char(1),
| SUPERTASK_ bigint,
| EXECUTION_ bigint,
| PROCINST_ bigint,
| SWIMLANE_ bigint,
| TASKDEFNAME_ varchar(255),
| primary key (DBID_)
| );
|
| create table JBPM4_VARIABLE (
| DBID_ bigint generated by default as identity (start with 1, increment by 1),
| CLASS_ varchar(255) not null,
| DBVERSION_ integer not null,
| KEY_ varchar(255),
| CONVERTER_ varchar(255),
| HIST_ char(1),
| EXECUTION_ bigint,
| TASK_ bigint,
| LOB_ bigint,
| DATE_VALUE_ timestamp,
| DOUBLE_VALUE_ double,
| CLASSNAME_ varchar(255),
| LONG_VALUE_ bigint,
| STRING_VALUE_ long varchar,
| TEXT_VALUE_ clob,
| EXESYS_ bigint,
| primary key (DBID_)
| );
|
| create index IDX_DEPLPROP_DEPL on JBPM4_DEPLOYPROP (DEPLOYMENT_);
|
| alter table JBPM4_DEPLOYPROP
| add constraint FK_DEPLPROP_DEPL
| foreign key (DEPLOYMENT_)
| references JBPM4_DEPLOYMENT;
|
| create index IDX_EXEC_SUPEREXEC on JBPM4_EXECUTION (SUPEREXEC_);
|
| create index IDX_EXEC_INSTANCE on JBPM4_EXECUTION (INSTANCE_);
|
| create index IDX_EXEC_SUBPI on JBPM4_EXECUTION (SUBPROCINST_);
|
| create index IDX_EXEC_PARENT on JBPM4_EXECUTION (PARENT_);
|
| alter table JBPM4_EXECUTION
| add constraint FK_EXEC_PARENT
| foreign key (PARENT_)
| references JBPM4_EXECUTION;
|
| alter table JBPM4_EXECUTION
| add constraint FK_EXEC_SUBPI
| foreign key (SUBPROCINST_)
| references JBPM4_EXECUTION;
|
| alter table JBPM4_EXECUTION
| add constraint FK_EXEC_INSTANCE
| foreign key (INSTANCE_)
| references JBPM4_EXECUTION;
|
| alter table JBPM4_EXECUTION
| add constraint FK_EXEC_SUPEREXEC
| foreign key (SUPEREXEC_)
| references JBPM4_EXECUTION;
|
| create index IDX_HACTI_HPROCI on JBPM4_HIST_ACTINST (HPROCI_);
|
| create index IDX_HTI_HTASK on JBPM4_HIST_ACTINST (HTASK_);
|
| alter table JBPM4_HIST_ACTINST
| add constraint FK_HACTI_HPROCI
| foreign key (HPROCI_)
| references JBPM4_HIST_PROCINST;
|
| alter table JBPM4_HIST_ACTINST
| add constraint FK_HTI_HTASK
| foreign key (HTASK_)
| references JBPM4_HIST_TASK;
|
| create index IDX_HDET_HACTI on JBPM4_HIST_DETAIL (HACTI_);
|
| create index IDX_HDET_HPROCI on JBPM4_HIST_DETAIL (HPROCI_);
|
| create index IDX_HDETAIL_HACTI on JBPM4_HIST_DETAIL (HACTI_);
|
| create index IDX_HDETAIL_HVAR on JBPM4_HIST_DETAIL (HVAR_);
|
| create index IDX_HDETAIL_HTASK on JBPM4_HIST_DETAIL (HTASK_);
|
| create index IDX_HDETAIL_HPROCI on JBPM4_HIST_DETAIL (HPROCI_);
|
| create index IDX_HDET_HVAR on JBPM4_HIST_DETAIL (HVAR_);
|
| create index IDX_HDET_HTASK on JBPM4_HIST_DETAIL (HTASK_);
|
| alter table JBPM4_HIST_DETAIL
| add constraint FK_HDETAIL_HPROCI
| foreign key (HPROCI_)
| references JBPM4_HIST_PROCINST;
|
| alter table JBPM4_HIST_DETAIL
| add constraint FK_HDETAIL_HACTI
| foreign key (HACTI_)
| references JBPM4_HIST_ACTINST;
|
| alter table JBPM4_HIST_DETAIL
| add constraint FK_HDETAIL_HTASK
| foreign key (HTASK_)
| references JBPM4_HIST_TASK;
|
| alter table JBPM4_HIST_DETAIL
| add constraint FK_HDETAIL_HVAR
| foreign key (HVAR_)
| references JBPM4_HIST_VAR;
|
| alter table JBPM4_HIST_TASK
| add constraint FK_HSUPERT_SUB
| foreign key (SUPERTASK_)
| references JBPM4_HIST_TASK;
|
| create index IDX_HVAR_HPROCI on JBPM4_HIST_VAR (HPROCI_);
|
| create index IDX_HVAR_HTASK on JBPM4_HIST_VAR (HTASK_);
|
| alter table JBPM4_HIST_VAR
| add constraint FK_HVAR_HPROCI
| foreign key (HPROCI_)
| references JBPM4_HIST_PROCINST;
|
| alter table JBPM4_HIST_VAR
| add constraint FK_HVAR_HTASK
| foreign key (HTASK_)
| references JBPM4_HIST_TASK;
|
| create index IDX_GROUP_PARENT on JBPM4_ID_GROUP (PARENT_);
|
| alter table JBPM4_ID_GROUP
| add constraint FK_GROUP_PARENT
| foreign key (PARENT_)
| references JBPM4_ID_GROUP;
|
| create index IDX_MEM_USER on JBPM4_ID_MEMBERSHIP (USER_);
|
| create index IDX_MEM_GROUP on JBPM4_ID_MEMBERSHIP (GROUP_);
|
| alter table JBPM4_ID_MEMBERSHIP
| add constraint FK_MEM_GROUP
| foreign key (GROUP_)
| references JBPM4_ID_GROUP;
|
| alter table JBPM4_ID_MEMBERSHIP
| add constraint FK_MEM_USER
| foreign key (USER_)
| references JBPM4_ID_USER;
|
| create index IDX_JOBRETRIES on JBPM4_JOB (RETRIES_);
|
| create index IDX_JOB_CFG on JBPM4_JOB (CFG_);
|
| create index IDX_JOB_PRINST on JBPM4_JOB (PROCESSINSTANCE_);
|
| create index IDX_JOB_EXE on JBPM4_JOB (EXECUTION_);
|
| create index IDX_JOBLOCKEXP on JBPM4_JOB (LOCKEXPTIME_);
|
| create index IDX_JOBDUEDATE on JBPM4_JOB (DUEDATE_);
|
| alter table JBPM4_JOB
| add constraint FK_JOB_CFG
| foreign key (CFG_)
| references JBPM4_LOB;
|
| create index IDX_LOB_DEPLOYMENT on JBPM4_LOB (DEPLOYMENT_);
|
| alter table JBPM4_LOB
| add constraint FK_LOB_DEPLOYMENT
| foreign key (DEPLOYMENT_)
| references JBPM4_DEPLOYMENT;
|
| create index IDX_PART_TASK on JBPM4_PARTICIPATION (TASK_);
|
| alter table JBPM4_PARTICIPATION
| add constraint FK_PART_SWIMLANE
| foreign key (SWIMLANE_)
| references JBPM4_SWIMLANE;
|
| alter table JBPM4_PARTICIPATION
| add constraint FK_PART_TASK
| foreign key (TASK_)
| references JBPM4_TASK;
|
| create index IDX_SWIMLANE_EXEC on JBPM4_SWIMLANE (EXECUTION_);
|
| alter table JBPM4_SWIMLANE
| add constraint FK_SWIMLANE_EXEC
| foreign key (EXECUTION_)
| references JBPM4_EXECUTION;
|
| create index IDX_TASK_SUPERTASK on JBPM4_TASK (SUPERTASK_);
|
| alter table JBPM4_TASK
| add constraint FK_TASK_SWIML
| foreign key (SWIMLANE_)
| references JBPM4_SWIMLANE;
|
| alter table JBPM4_TASK
| add constraint FK_TASK_SUPERTASK
| foreign key (SUPERTASK_)
| references JBPM4_TASK;
|
| create index IDX_VAR_EXESYS on JBPM4_VARIABLE (EXESYS_);
|
| create index IDX_VAR_TASK on JBPM4_VARIABLE (TASK_);
|
| create index IDX_VAR_EXECUTION on JBPM4_VARIABLE (EXECUTION_);
|
| create index IDX_VAR_LOB on JBPM4_VARIABLE (LOB_);
|
| alter table JBPM4_VARIABLE
| add constraint FK_VAR_LOB
| foreign key (LOB_)
| references JBPM4_LOB;
|
| alter table JBPM4_VARIABLE
| add constraint FK_VAR_EXECUTION
| foreign key (EXECUTION_)
| references JBPM4_EXECUTION;
|
| alter table JBPM4_VARIABLE
| add constraint FK_VAR_EXESYS
| foreign key (EXESYS_)
| references JBPM4_EXECUTION;
|
| alter table JBPM4_VARIABLE
| add constraint FK_VAR_TASK
| foreign key (TASK_)
| references JBPM4_TASK;
|
The hbm config would be:
<property name="hibernate.dialect">org.hibernate.dialect.DerbyDialect</property>
| <property name="hibernate.connection.driver_class">org.apache.derby.jdbc.ClientDriver</property>
| <property name="hibernate.connection.url">jdbc:derby://localhost:1527/jbpm4</property>
| <property name="hibernate.connection.username">USER</property>
| <property name="hibernate.connection.password">PW</property>
Perhaps, this helps some people with similar problems.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4264058#4264058
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4264058
16 years, 5 months