I've working on an application right now using T4+hibernate+spring and have 0 problems with it. I didn't read all of the thread, but what problems were you having?

I used the tapestry-spring.jar found here http://wiki.apache.org/jakarta-tapestry/Tapestry4Spring I haven't tried Howard's version yet (http://howardlewisship.com/tapestry-javaforge/tapestry-spring/).

Some other tips are:
Use OpenSessionInViewFilter http://wiki.apache.org/jakarta-tapestry/FrequentlyAskedQuestions/SpringHibernate to prevent Lazy Loading exceptions.

Make sure you read the documentation for Spring's OpenSessionInViewFilter carefully
http://www.springframework.org/docs/api/org/springframework/orm/hibernate/support/OpenSessionInViewFilter.html

I extended OpenSessionInViewFilter  like this:
protected Session getSession(SessionFactory sessionFactory) throws DataAccessResourceFailureException {
   Session session = super.getSession(sessionFactory);
   session.setFlushMode(FlushMode.AUTO);
   return session;
 }

protected void closeSession(Session session, SessionFactory sessionFactory) {
   session.flush();
   super.closeSession(session, sessionFactory);
 }

This prevents FlushMode.NONE exceptions, and prevents commits not showing up in the database.



----- Original Message ----- From: "Andreas Bulling" <[EMAIL PROTECTED]>
To: "Tapestry users" <[email protected]>
Sent: Monday, February 20, 2006 1:24 PM
Subject: Re: [OT] Re: Best practice - Integration Hibernate/Tapestry


Hi Lutz,

| wow, this thread is really wandering off a bit... I will at least try
| to stick to the point.

That's right. But anyway very useful/interesting for many people as I'm not
the only one struggling with problems as it seems. ;)

Let me describe what I did in the meanwhile:
I've set up everything _with Spring_ and at least I got further than using
Hivemind (means: For the first time Hibernate created the database tables! jipii).

But even at this early point I think that Spring is very probably too
big for my needs... Well, as its not a big issue to switch back to
Hivemind (by just removing the tapestry-spring and spring jars and
re-enabling some hivemodule.xml configuration) I decided to try that.
Call me a masochist but now _I_ _just_ _want_ _to_ _know_ :)

Now, I'm using HiveTrans (as this seems to be the easiest solution)
and followed the documentation on
http://hivetranse.sourceforge.net/quickstart.html

I've put all necessary libraries under WEB-INF/lib but receive
the following error message, now:
---
javax.servlet.ServletException: Unable to initialize application servlet: Error at jar:file:/home/andreas/workspace/ecgplattformng/context/WEB-INF/lib/hivetranse.core.jar!/META-INF/hivemodule.xml, line 20, column 59: Configuration point hivetranse.core.TransactionDefaults contains no contributions but expects exactly one contribution.
org.apache.tapestry.ApplicationServlet.init(ApplicationServlet.java:206)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
java.lang.Thread.run(Thread.java:595)

root cause

org.apache.hivemind.ApplicationRuntimeException: Error at jar:file:/home/andreas/workspace/ecgplattformng/context/WEB-INF/lib/hivetranse.core.jar!/META-INF/hivemodule.xml, line 20, column 59: Configuration point hivetranse.core.TransactionDefaults contains no contributions but expects exactly one contribution. [jar:file:/home/andreas/workspace/ecgplattformng/context/WEB-INF/lib/hivetranse.core.jar!/META-INF/hivemodule.xml, line 20, column 59]
org.apache.hivemind.impl.StrictErrorHandler.error(StrictErrorHandler.java:39)
org.apache.hivemind.impl.RegistryInfrastructureConstructor.checkContributionCounts(RegistryInfrastructureConstructor.java:678)
org.apache.hivemind.impl.RegistryInfrastructureConstructor.constructRegistryInfrastructure(RegistryInfrastructureConstructor.java:180)
org.apache.hivemind.impl.RegistryBuilder.constructRegistry(RegistryBuilder.java:151)
org.apache.tapestry.ApplicationServlet.constructRegistry(ApplicationServlet.java:253)
org.apache.tapestry.ApplicationServlet.init(ApplicationServlet.java:194)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
java.lang.Thread.run(Thread.java:595)

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to