You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dave Newton <ne...@pingsite.com> on 2006/08/26 17:03:07 UTC

RequestProcessor/Hibernate3/Transactions [hib3tx]

Hi all,

Somehow got roped into doing another Struts (old-sk00l) project?!

We're using Struts 1.2.x/Hibernate3 on Weblogic 8.1 and I have a
question regarding how people have dealt with transactions and exception
recovery.

My first solution was a filter (I've currently handling Ajax requests
via servlets, although that might change) but may want to wrap the
Actions with a transaction-handling RequestProcessor instead. This also
kind of hosed the way we had been planning on handling exceptions, since
exceptions could be thrown on the commit after the Actions have executed.

I don't want to handle Tx's in my Actions (to avoid exceptions in JSPs
if we need to lazy-load something), and since we're using the
HibernateTools with the default templates for the DAOs this seems the
best solution (i.e., no Tx's in the DAOs).


The other major thing we want to handle "appropriately" is DB-oriented
exceptions; we were considering mapping exceptions inside the request
processor to application-specific ones which would be handled declaratively.

How have other people generally solved this problem? I'm new to
Hibernate3 and the previously Hibernate tools I've used (Middlegen) have
generated DAOs where queries either didn't need to be inside a Tx (?! Is
that right?) or did some other magic (I never poked around much in them)
such that lazy-loading inside a JSP didn't throw anything.

Hints? Pointers?

Thanks! And hi all!

Dave



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org