I'm not entirely sure I understand what you want.... let me try to
restate it:
-- calls to the mdb should be run in a JTA transaction, so if you
call setRollbackOnly the message will be redelivered
-- whether the JTA transaction commits or rolls back, the hibernate
work should be done in a separate hibernate-controlled hibernate
transaction
You can get this effect by using container managed transaction for
the MDB and using a no-transaction datasource for hibernate. If you
generated the plan for the datasource using the console it will have
a <local-transaction> element; if you replace this with <no-
transaction> and deploy the plan from the command line or "deploy
new" in the console you should get a suitable configuration.
thanks
david jencks
On Oct 11, 2007, at 5:52 AM, Jochen Zink wrote:
Hello,
I'm using Hibernate 3.2, Geronimo 2.0.1 and I have a MDB.
Hibernate uses a global Connection Pool, which is deployed in
Geronimo. That works.
Inside the MDB there are some Saveactions to the database, which
looks like this:
Session session = Sessionfactory.openSession();
Transaction tx = session.beginTransaction();
session.save(..);
tx.commit();
session.close();
etc.
My problem is, that no object is stored to the Database, after the
commit();
I guess, this is only a Configuration Problem, from Hibernate And/
or the MDBs Transaction Type.
If I call setRollbackOnly() on the MessageDrivenContext(), I want
that only the Message is redelivered to the MDB and not, that the
hibernateTransactions are rollbacked. (Sorry for my bad English).
The Transaction-Type of the MDB is set to Bean (is this right?)
And the Hibernateconfiguration looks like this:
hibernate.connection.datasource=java:comp/env/jdbc/
pushAEConnectionPool
hibernate.dialect=org.hibernate.dialect.Oracle9Dialect
hibernate.hbm2ddl.auto=validate
I believe, that there must be some stuff like
hibernate.transaction.factory_class=org.hibernate.transaction.JTATrans
actionFactory
hibernate.current_session_context_class=jta
hibernate.transaction.manager_lookup_class=?
But, I also believe, that the simple stuff, without using
JTATransactions should work.
The whole application runs perfectly, if I use a local DataSource
and not a Hibernate ConnectionPool.
I found this example, but I was not able to find a solution for my
problem inside.
http://cwiki.apache.org/GMOxDOC20/jboss-to-geronimo-hibernate-
migration.html
Thanks a lot for your help.
Regards
Jochen
______________________________________________________________________
____
Erweitern Sie FreeMail zu einem noch leistungsstärkeren E-Mail-
Postfach!
Mehr Infos unter http://produkte.web.de/club/?mc=021131