Whoops, meant to hit preview, not submit.
The following code is being run from a CMT SSBean. I see Hibernate running a
bunch of select statements before the save method is called. After the save,
however, I don't see any insert or update statements. This makes me feel that
I've misconfigured something. I can force persistance to occur by telling the
Hibernate session to flush itself (jbpmSession.getSession().flush()).
Can anyone give me advice on what I might have misconfigured?
| public void testHelloWorldProcessDefinition()
| {
| JbpmSession jbpmSession = null;
| InitialContext initialContext = null;
| Connection con = null;
| try
| {
| initialContext = new InitialContext();
| Object jndiObject = initialContext.lookup(JNDINAME);
| JbpmSessionFactory instance = (JbpmSessionFactory)
| PortableRemoteObject.narrow(jndiObject,
JbpmSessionFactory.class);
| jbpmSession = instance.openJbpmSession();
| //
| // Tried this too.
| //
| // SessionFactory sessionFactory = instance.getSessionFactory();
| // Session currentSession = sessionFactory.getCurrentSession();
| // jbpmSession = instance.openJbpmSession(currentSession);
|
| ProcessDefinition processDefinition =
| jbpmSession.getGraphSession().
| findLatestProcessDefinition("hello world");
| ProcessInstance processInstance =
| new ProcessInstance(processDefinition);
| Token token = processInstance.getRootToken();
| token.signal();
| jbpmSession.getGraphSession().
| saveProcessInstance(processInstance);
| }
| catch (Exception e)
| {
| e.printStackTrace();
| fail("Failure!:\n" + e.getMessage());
| }
| finally
| {
| jbpmSession.close();
| initialContext.close();
| }
| }
|
I've included some logging output from jbpm/hibernate when the sessionfactory
is being configured below.
| 13:57:49,923 INFO [WrapperDataSourceService] Bound connection factory for
resource adapter for ConnectionManager
'jboss.jca:service=DataSourceBinding,name=JBPMDS to JNDI name 'java:JBPMDS'
| 13:57:49,946 INFO [Configuration] configuring from resource:
jbpm.hibernate.cfg.xml
| 13:57:49,946 INFO [Configuration] Configuration resource:
jbpm.hibernate.cfg.xml
| 13:57:51,627 INFO [Configuration] Configured SessionFactory: null
| 13:57:51,629 INFO [Configuration] processing extends queue
| .
| [HbmBinder] (removed for brevity)
| .
| 13:57:51,657 INFO [Configuration] processing association property
references
| 13:57:51,657 INFO [Configuration] processing foreign key constraints
| 13:57:51,681 INFO [ConnectionProviderFactory] Initializing connection
provider: org.hibernate.connection.DatasourceConnectionProvider
| 13:57:51,683 INFO [NamingHelper] JNDI InitialContext properties:{}
| 13:57:51,689 INFO [DatasourceConnectionProvider] Using datasource:
java:/JBPMDS
| 13:57:51,781 INFO [SettingsFactory] RDBMS: Oracle, version: Oracle9i
Enterprise Edition Release 9.2.0.4.0 - 64bit Production With the Partitioning,
OLAP and Oracle Data Mining options JServer Release 9.2.0.4.0 - Production
| 13:57:51,781 INFO [SettingsFactory] JDBC driver: Oracle JDBC driver,
version: 9.2.0.3.0
| 13:57:51,783 INFO [Dialect] Using dialect:
org.hibernate.dialect.Oracle9Dialect
| 13:57:51,785 INFO [TransactionFactoryFactory] Transaction strategy:
org.hibernate.transaction.CMTTransactionFactory
| 13:57:51,785 INFO [TransactionManagerLookupFactory] instantiating
TransactionManagerLookup:
org.hibernate.transaction.JBossTransactionManagerLookup
| 13:57:51,785 INFO [TransactionManagerLookupFactory] instantiated
TransactionManagerLookup
| 13:57:51,785 INFO [SettingsFactory] Automatic flush during
beforeCompletion(): enabled
| 13:57:51,785 INFO [SettingsFactory] Automatic session close at end of
transaction: enabled
| 13:57:51,785 INFO [SettingsFactory] JDBC batch size: 15
| 13:57:51,786 INFO [SettingsFactory] JDBC batch updates for versioned data:
disabled
| 13:57:51,786 INFO [SettingsFactory] Scrollable result sets: enabled
| 13:57:51,786 INFO [SettingsFactory] JDBC3 getGeneratedKeys(): disabled
| 13:57:51,786 INFO [SettingsFactory] Connection release mode: auto
| 13:57:51,786 INFO [SettingsFactory] Default batch fetch size: 1
| 13:57:51,786 INFO [SettingsFactory] Generate SQL with comments: disabled
| 13:57:51,786 INFO [SettingsFactory] Order SQL updates by primary key:
disabled
| 13:57:51,786 INFO [SettingsFactory] Query translator:
org.hibernate.hql.ast.ASTQueryTranslatorFactory
| 13:57:51,788 INFO [ASTQueryTranslatorFactory] Using
ASTQueryTranslatorFactory
| 13:57:51,788 INFO [SettingsFactory] Query language substitutions: {}
| 13:57:51,788 INFO [SettingsFactory] Second-level cache: enabled
| 13:57:51,788 INFO [SettingsFactory] Query cache: disabled
| 13:57:51,788 INFO [SettingsFactory] Cache provider:
org.hibernate.cache.EhCacheProvider
| 13:57:51,789 INFO [SettingsFactory] Optimize cache for minimal puts:
disabled
| 13:57:51,789 INFO [SettingsFactory] Structured second-level cache entries:
disabled 13:57:51,790 INFO [SettingsFactory] Echoing all SQL to stdout
13:57:51,790 INFO [SettingsFactory] Statistics: disabled 13:57:51,790 INFO
[SettingsFactory] Deleted entity synthetic identifier rollback: disabled
13:57:51,790 INFO [SettingsFactory] Default entity-mode: pojo
| 13:57:51,806 INFO [SessionFactoryImpl] building session factory
| 13:57:53,978 INFO [SessionFactoryObjectFactory] Factory name:
java:com/env/hibernate/SessionFactory
| 13:57:53,979 INFO [NamingHelper] JNDI InitialContext properties:{}
13:57:53,980 INFO [SessionFactoryObjectFactory] Bound factory to JNDI name:
java:com/env/hibernate/SessionFactory
| 13:57:53,981 WARN [SessionFactoryObjectFactory] InitialContext did not
implement EventContext
| 13:57:53,981 INFO [NamingHelper] JNDI InitialContext properties:{}
| 13:57:53,982 INFO [SessionFactoryImpl] Checking 0 named HQL queries
| 13:57:53,982 INFO [SessionFactoryImpl] Checking 0 named SQL queries
| 13:57:53,983 INFO [JbpmService] binding JbpmSessionFactory
'java:/jbpm/JbpmSessionFactory' into JNDI...
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3915648#3915648
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3915648
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user