Marcus, thanks for the response. I'm curious if you've encountered any reason to override the other services, besides direct? For example, we use ExternalLink quite a bit, although AFAIK, no data actually gets updated from those pages, they are still wrapped in a transaction.
If anyone else is interested, there's (obviously?) a bit of hivemodule config that has to happen to make this work--something like: <!-- define a direct service replacement --> <service-point id="MyDirect" interface="org.apache.tapestry.engine.IEngineService"> <invoke-factory> <construct class="bt.havoc.tapestry.TransactionalDirectService"> <set-object property="responseRenderer" value="infrastructure:responseRenderer"/> <set-object property="request" value="infrastructure:request"/> <set-object property="linkFactory" value="infrastructure:linkFactory"/> <set-object property="requestCycle" value="infrastructure:requestCycle"/> </construct> </invoke-factory> </service-point> <!-- tell tapestry to use the new service --> <contribution configuration-id="tapestry.services.ApplicationServices"> <service name="direct" object="service:MyDirect"/> </contribution> On Wednesday 10 May 2006 02:26, Schulte Marcus wrote: > Tapernate relies on spring's ta-demarcation stuff to mark ta's for > rollback. So, if something happens above your dao-layer, spring can't know > it. > > I override DirectService to this end, see below. Something similar should > also work with > tapernate-style SessionFactory instead of "svc". > > public class TransactionalDirectService extends DirectService { > > private PersistenceService svc; > private Log log; > > public TransactionalDirectService( PersistenceService s ) { > svc = s; > } > > public void setLog( Log l ) { > log = l; > } > > > @Override > protected void triggerComponent(IRequestCycle cycle, IDirect direct, > Object[] parameters) { > try { > log.debug("Trigger component transactional"); > super.triggerComponent(cycle, direct, parameters); > log.debug("Trigger component success - committing"); > svc.commit(); > } catch ( StaleObjectStateException e ){ > log.debug("Stale object - rolling back"); > svc.rollback(); > cycle.activate("StaleObject"); > } catch ( RuntimeException e ) { > log.debug("Trigger component threw - rolling back"); > svc.rollback(); > throw e; > } > } > > > } > -- Sister Mary headed through the night-time hospital with the Adversary, Destroyer of Kings, Angel of the Bottomless Pit, Great Beast that is called Dragon, Prince of This World, Father of Lies, Spawn of Satan and Lord of Darkness safely in her arms. She found a bassinet and laid him down in it. He gurgled. She gave him a tickle. -- The antichrist is born (Terry Pratchett & Neil Gaiman, Good Omens) -------------- Jason Dyer BlueTarp Financial, inc. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]