This content has been marked as final. Show 2 replies
DO i Need to create hibernate mapping for my table?
No. We encorauge you to do so, for uniformity (jBPM already uses Hibernate) and maintainability (avoid CUD statements all around).
is it possible to get handle to connection from [execution] context ?
Not exactly from the context, but from a thread local encapsulated in class JbpmSession:
JbpmSession jbpmSession = JbpmSession.getCurrentJbpmSession(); Connection jdbcConnection = jbpmSession.getConnection(); /* now do stuff with the jdbcConnection */
Note that in order for this to work, a jBPM session must have been opened earlier in the current thread. This is the case when you load a token from the database and then signal it.
As an alternative to using the connection directly, you can use Hibernate's native SQL support.
is there an issue with doing that?
None, just remember you have to manage your statements but not the connection.
thanks for answering my question.