Re: Hibernate persisted data never makes it to DB
Like I said before, I have not been using any transaction manager. I thought that it would not be necessary - or better that in case there is none, the behaviour would be to just commit a query as soon as it comes through. I added TransactionManager, Interceptor and AutoProxyCreator and everything works now, and keeps working after turning autocommit off again. Some more things below... Mark, I added hibernate.connection.autocommit=true to my hibernate.properties and that fixed it... hm. I don't know if that's a good idea. I'm not comfortable with hibernate.properties in a Spring environment, anyway. Is it clear to you in which order they are read? I do not use spring to configure hibernate in all details. I use hibernate.properties and use Spring to wire the SessionFactory together with all the other pieces One last question, to get back to Tapestry - is Spring's OpenSessionInViewFilter going to work with Tapestry without limitations? Afaik yes. What limitations where you thinking of? I can't think of any right now. I don't understand the apparent popularity of it, though, I think it's not that good a concept. I didn't think of anything in particular. I was trying to figure out if I should use Tapernate, HiveTranse, or HoneyComb or if I could simply (not sure which one is easier - probably a matter of taste and habit!?) use OpenSessionInViewFilter instead of all these other options. I guess I had not considered that the reason why people are not using OpenSessionInViewFilter is that they don't use Spring at all in the first place. I see all these posts about Tapernate and others, but I'm not sure whether OpenSessionInViewFilter will work... I might be mistaken, but I thought Tapernate was about providing a Hibernate session factory through hivemind, allowing you to inject it into your Daos *without* Spring. Plus some extra stuff for convenience (similar to the OpenSessionInViewFilter from Spring). What is the benefit of Tapernate when you are going to use Spring anyway? Maybe someone could enlighten me on this? I'll start a new thread on that, I have a similar question as well... MARK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tapernate and Spring
Hi all, In a recent different thread, the question about Why use Tapernate if you use Spring had come up as a side-question. It seems that some (Hibernate-related) features of Tapernate are alternatives to equivalent Spring features, while others are more Tapestry-related features (e.g. the DataSqueezer) that are not available in Spring, since Spring does not have explicit Tapestry-support. For some of the features listed on the feature-list at http://www.carmanconsulting.com/tapernate/ I am not sure which category they belong to: - Is there anything in Spring that deals with the reattachment-strategies (Persistence Strategies on the list)? - Is the POJO-Rollback functionality covered by Spring's Transaction facility? Does anybody know if there is a document with a comparison of the various frameworks/add-on libs that offer persistence-support (Tapernate, Hivetranse, Honeycomb, [Spring]; are there more?) for Tapestry? Like a quick features and pros/cons comparison? Thanks, MARK P.S. James, did you forget to list the transaction-strategies on the feature list, or did you leave it out intentionally? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
List loaded twice from DB
Hi, I have a simple CRUD scenario with a ListPage and a ModifyPage. The ListPage gets all records from the DB by calling the method getAllRooms() of a RoomAdminService and lists them in a table. For some reason the query select * from rooms is executed twice every time the page is accessed. getAllRooms() is only referenced once in the .page file to plug a page property, the .html file then references that property I compared the StackTraces of the two calls, they have identical tops and bottoms, but differ somwhere in the middle: at $RoomListPage_3.finishLoad($RoomListPage_3.java) at org.apache.tapestry.pageload.PageLoader.constructComponent(PageLoader.java:439) at org.apache.tapestry.pageload.PageLoader.loadPage(PageLoader.java:613) at $IPageLoader_10b79e6e7bf.loadPage($IPageLoader_10b79e6e7bf.java) at $IPageLoader_10b79e6e7c0.loadPage($IPageLoader_10b79e6e7c0.java) at org.apache.tapestry.pageload.PageSource.getPage(PageSource.java:120) at $IPageSource_10b79e6e724.getPage($IPageSource_10b79e6e724.java) at org.apache.tapestry.engine.RequestCycle.loadPage(RequestCycle.java:268) at org.apache.tapestry.engine.RequestCycle.getPage(RequestCycle.java:251) at org.apache.tapestry.engine.RequestCycle.activate(RequestCycle.java:609) at org.apache.tapestry.engine.PageService.service(PageService.java:66) at $IEngineService_10b79e6e7af.service($IEngineService_10b79e6e7af.java) at org.apache.tapestry.services.impl.EngineServiceOuterProxy.service(EngineServiceOuterProxy.java:66) and at $RoomListPage_3.pageDetached($RoomListPage_3.java) at org.apache.tapestry.AbstractPage.firePageDetached(AbstractPage.java:452) at org.apache.tapestry.AbstractPage.detach(AbstractPage.java:140) at org.apache.tapestry.pageload.PageSource.releasePage(PageSource.java:147) at $IPageSource_10b79e6e724.releasePage($IPageSource_10b79e6e724.java) at org.apache.tapestry.engine.RequestCycle.cleanup(RequestCycle.java:192) So it seems like the first call comes out of the finishLoad(), while the second call is caused by pageDetached() of my ListPage. Does anybody know why it would access the getAllRooms() twice? Thanks, MARK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tapernate and Spring
Well, the trick is that Spring would have to know when to reattach the objects (before the persistent property is used). Since they don't have Tapestry support, then they can't exactly know that. As far as I know, nobody has ever done the POJO rollback stuff before. I asked specifically about it in the Hibernate forum and I've posted a Jira issue. Neither one got much traffic really (other than use merge and keep the original objects around in case all goes haywire). As of right now, I don't know of any comparison charts for Tapernate, Hivetranse, and Honeycomb. Marcus (the Honeycomb guy) and I have spoken in the past about maybe putting our heads together to put conversation support into Tapernate and then migrating Honeycomb to use Tapernate. Since it's a public project now, we may be able to more easily do that. I would love to see Hivetranse move over to Tapernate too. Maybe we can all three (Jean-Francois, Marcus, and I) get together and try to come up with *the* way to do Tapestry/Hibernate integration. James -Original Message- From: Mark [mailto:[EMAIL PROTECTED] Sent: Sunday, May 28, 2006 3:28 AM To: Tapestry users Subject: Tapernate and Spring Hi all, In a recent different thread, the question about Why use Tapernate if you use Spring had come up as a side-question. It seems that some (Hibernate-related) features of Tapernate are alternatives to equivalent Spring features, while others are more Tapestry-related features (e.g. the DataSqueezer) that are not available in Spring, since Spring does not have explicit Tapestry-support. For some of the features listed on the feature-list at http://www.carmanconsulting.com/tapernate/ I am not sure which category they belong to: - Is there anything in Spring that deals with the reattachment-strategies (Persistence Strategies on the list)? - Is the POJO-Rollback functionality covered by Spring's Transaction facility? Does anybody know if there is a document with a comparison of the various frameworks/add-on libs that offer persistence-support (Tapernate, Hivetranse, Honeycomb, [Spring]; are there more?) for Tapestry? Like a quick features and pros/cons comparison? Thanks, MARK P.S. James, did you forget to list the transaction-strategies on the feature list, or did you leave it out intentionally? - 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]
Re: Re: @[EMAIL PROTECTED] not working as expected
Hi, It sounds like a bug to me. Can you file this in jira ? When using @Persist and @InitialValue on the same property the value is not persisted. The only value returned from the property is the initial value. It seems like that when the initial value is set right before the page is returned to the pool, the persistent value is also set to the initial value. The expected behaviour, I think, is that the property will return the initial value the first time it is used, and then, after that, the persistent value should be returned. According to Howard (http://thread.gmane.org/gmane.comp.java.tapestry.user/31514/focus=31516) and javadoc (PersistAnnotationWorker.java) it's a feature. But I think an arguable one, because it contradicts the expected behavior. Dennis -- Bis zu 70% Ihrer Onlinekosten sparen: GMX SmartSurfer! Kostenlos downloaden: http://www.gmx.net/de/go/smartsurfer - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tapestry email service
Hi Ted, It sounds like you don't have any JNDI available on your server. Wouldn't you be using Jetty? Jetty doesn't have any JNDI by default and I never did figure out how to get Javamail working in Jetty. My service assumes that a Javamail session is available through JNDI on mail/Session. On tomcat I have in server.xml Resource name=mail/Session type=javax.mail.Session mail.smtp.host=smtp.server.com mail.mime.charset=ISO-8859-1/ and I have a context.xml inside my war file with ResourceLink name=mail/Session global=mail/Session type= javax.mail.Session/ On 5/27/06, Ted Steen [EMAIL PROTECTED] wrote: I get this exception when I try to send a mail with the service (just like you do in your example) I'm using javax.mail 1.4 and javax.activation 1.1 (as needed by javax.mail ) javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial at javax.naming.spi.NamingManager.getInitialContext( NamingManager.java:645) at javax.naming.InitialContext.getDefaultInitCtx( InitialContext.java:247) at javax.naming.InitialContext.getURLOrDefaultInitCtx( InitialContext.java:284) at javax.naming.InitialContext.lookup(InitialContext.java:351) at actualis.web.tapestry.email.EmailEngineImpl.getMailSession( EmailEngineImpl.java:111) at actualis.web.tapestry.email.EmailEngineImpl.sendMessage( EmailEngineImpl.java:220) at actualis.web.tapestry.email.EmailEngineImpl.renderAndSendPage( EmailEngineImpl.java:148) at actualis.web.tapestry.email.EmailEngineImpl.sendEmail( EmailEngineImpl.java:172) at $EmailEngine_10b756c789e.sendEmail($EmailEngine_10b756c789e.java) at $EmailEngine_10b756c789d.sendEmail($EmailEngine_10b756c789d.java) at net.keso.ted.tapestrySandbox.pages.mail.MailTest.doSendMail( MailTest.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke( NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke( DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.tapestry.listener.ListenerMethodInvokerImpl.invokeTargetMethod( ListenerMethodInvokerImpl.java:214) at org.apache.tapestry.listener.ListenerMethodInvokerImpl.invokeListenerMethod (ListenerMethodInvokerImpl.java:155) at org.apache.tapestry.listener.ListenerMethodInvokerImpl.searchAndInvoke( ListenerMethodInvokerImpl.java:124) at org.apache.tapestry.listener.ListenerMethodInvokerImpl.invokeListenerMethod (ListenerMethodInvokerImpl.java:65) at org.apache.tapestry.listener.SyntheticListener.actionTriggered( SyntheticListener.java:51) at org.apache.tapestry.binding.ListenerMethodBinding.actionTriggered( ListenerMethodBinding.java:77) at org.apache.tapestry.listener.ListenerInvokerTerminator.invokeListener( ListenerInvokerTerminator.java:51) at $ListenerInvoker_10b756c7786.invokeListener($ListenerInvoker_10b756c7786.java) at $ListenerInvoker_10b756c7785.invokeListener($ListenerInvoker_10b756c7785.java) at org.apache.tapestry.link.DirectLink.trigger(DirectLink.java:105) at org.apache.tapestry.engine.DirectService.triggerComponent( DirectService.java:146) at org.apache.tapestry.engine.DirectService.service( DirectService.java:132) at $IEngineService_10b756c77f1.service($IEngineService_10b756c77f1.java) at org.apache.tapestry.services.impl.EngineServiceOuterProxy.service( EngineServiceOuterProxy.java:66) at org.apache.tapestry.engine.AbstractEngine.service( AbstractEngine.java:248) at org.apache.tapestry.services.impl.InvokeEngineTerminator.service (InvokeEngineTerminator.java:60) at $WebRequestServicer_10b756c77bd.service($WebRequestServicer_10b756c77bd.java) at com.carmanconsulting.tapernate.filter.TapernateFilter.service( TapernateFilter.java:69) at $WebRequestServicerFilter_10b756c77bb.service($WebRequestServicerFilter_10b756c77bb.java) at $WebRequestServicer_10b756c77bf.service($WebRequestServicer_10b756c77bf.java) at $WebRequestServicer_10b756c77b7.service($WebRequestServicer_10b756c77b7.java) at org.apache.tapestry.services.impl.WebRequestServicerPipelineBridge.service (WebRequestServicerPipelineBridge.java:56) at $ServletRequestServicer_10b756c779b.service($ServletRequestServicer_10b756c779b.java) at org.apache.tapestry.request.DecodedRequestInjector.service( DecodedRequestInjector.java:55) at $ServletRequestServicerFilter_10b756c7797.service($ServletRequestServicerFilter_10b756c7797.java) at $ServletRequestServicer_10b756c779d.service($ServletRequestServicer_10b756c779d.java) at org.apache.tapestry.multipart.MultipartDecoderFilter.service( MultipartDecoderFilter.java:52)
RE: Tapernate Moved (finally)...
Hugo, I just checked in a version of the ePluribus application that has been Tapernatized. It's in a branch: http://svn.javaforge.com/svn/tapestry/epluribus/brances/tapernate-impl I actually deleted more code than I wrote to get this working! :-) The application was based on an older version of the Java Persistence API, so I had to change some stuff around. But, it appears to be working (at least as much as it was in the first place). James -Original Message- From: Hugo Palma [mailto:[EMAIL PROTECTED] Sent: Friday, May 26, 2006 6:53 AM To: Tapestry users Subject: Re: Tapernate Moved (finally)... One more question to the list: - Are you going to move tapernate-example too ? I don't see it in the new svn repo. On 5/26/06, Massimo Lusetti [EMAIL PROTECTED] wrote: On 5/26/06, James Carman [EMAIL PROTECTED] wrote: Well, it's downloadable via SVN at (credentials: anonymous/anon): http://svn.javaforge.com/svn/tapestry/tapernate/trunk I have a version of the site set up, but I need to get it published to the main [EMAIL PROTECTED] site and I don't have control over that. If you want to view it, you can checkout tapernate and do a mvn site. The site docs will be available in the target directory (target/site/index.html). Enjoy! Thats great James, just two questions: - So the carmanconsulting.com svn repo is deprecated now? - From a fresh co it miss com.javaforge.hivemind:spring-hibernate3:jar:0.1 -- Massimo http://meridio.blogspot.com - 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]
Re: tapestry email service
You are right, I figured it out when I read your code. Now it is working fine. 2006/5/28, Henri Dupre [EMAIL PROTECTED]: Hi Ted, It sounds like you don't have any JNDI available on your server. Wouldn't you be using Jetty? Jetty doesn't have any JNDI by default and I never did figure out how to get Javamail working in Jetty. My service assumes that a Javamail session is available through JNDI on mail/Session. On tomcat I have in server.xml Resource name=mail/Session type=javax.mail.Session mail.smtp.host=smtp.server.com mail.mime.charset=ISO-8859-1/ and I have a context.xml inside my war file with ResourceLink name=mail/Session global=mail/Session type= javax.mail.Session/ On 5/27/06, Ted Steen [EMAIL PROTECTED] wrote: I get this exception when I try to send a mail with the service (just like you do in your example) I'm using javax.mail 1.4 and javax.activation 1.1 (as needed by javax.mail ) javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial at javax.naming.spi.NamingManager.getInitialContext( NamingManager.java:645) at javax.naming.InitialContext.getDefaultInitCtx( InitialContext.java:247) at javax.naming.InitialContext.getURLOrDefaultInitCtx( InitialContext.java:284) at javax.naming.InitialContext.lookup(InitialContext.java:351) at actualis.web.tapestry.email.EmailEngineImpl.getMailSession( EmailEngineImpl.java:111) at actualis.web.tapestry.email.EmailEngineImpl.sendMessage( EmailEngineImpl.java:220) at actualis.web.tapestry.email.EmailEngineImpl.renderAndSendPage( EmailEngineImpl.java:148) at actualis.web.tapestry.email.EmailEngineImpl.sendEmail( EmailEngineImpl.java:172) at $EmailEngine_10b756c789e.sendEmail($EmailEngine_10b756c789e.java) at $EmailEngine_10b756c789d.sendEmail($EmailEngine_10b756c789d.java) at net.keso.ted.tapestrySandbox.pages.mail.MailTest.doSendMail( MailTest.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke( NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke( DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.tapestry.listener.ListenerMethodInvokerImpl.invokeTargetMethod( ListenerMethodInvokerImpl.java:214) at org.apache.tapestry.listener.ListenerMethodInvokerImpl.invokeListenerMethod (ListenerMethodInvokerImpl.java:155) at org.apache.tapestry.listener.ListenerMethodInvokerImpl.searchAndInvoke( ListenerMethodInvokerImpl.java:124) at org.apache.tapestry.listener.ListenerMethodInvokerImpl.invokeListenerMethod (ListenerMethodInvokerImpl.java:65) at org.apache.tapestry.listener.SyntheticListener.actionTriggered( SyntheticListener.java:51) at org.apache.tapestry.binding.ListenerMethodBinding.actionTriggered( ListenerMethodBinding.java:77) at org.apache.tapestry.listener.ListenerInvokerTerminator.invokeListener( ListenerInvokerTerminator.java:51) at $ListenerInvoker_10b756c7786.invokeListener($ListenerInvoker_10b756c7786.java) at $ListenerInvoker_10b756c7785.invokeListener($ListenerInvoker_10b756c7785.java) at org.apache.tapestry.link.DirectLink.trigger(DirectLink.java:105) at org.apache.tapestry.engine.DirectService.triggerComponent( DirectService.java:146) at org.apache.tapestry.engine.DirectService.service( DirectService.java:132) at $IEngineService_10b756c77f1.service($IEngineService_10b756c77f1.java) at org.apache.tapestry.services.impl.EngineServiceOuterProxy.service( EngineServiceOuterProxy.java:66) at org.apache.tapestry.engine.AbstractEngine.service( AbstractEngine.java:248) at org.apache.tapestry.services.impl.InvokeEngineTerminator.service (InvokeEngineTerminator.java:60) at $WebRequestServicer_10b756c77bd.service($WebRequestServicer_10b756c77bd.java) at com.carmanconsulting.tapernate.filter.TapernateFilter.service( TapernateFilter.java:69) at $WebRequestServicerFilter_10b756c77bb.service($WebRequestServicerFilter_10b756c77bb.java) at $WebRequestServicer_10b756c77bf.service($WebRequestServicer_10b756c77bf.java) at $WebRequestServicer_10b756c77b7.service($WebRequestServicer_10b756c77b7.java) at org.apache.tapestry.services.impl.WebRequestServicerPipelineBridge.service (WebRequestServicerPipelineBridge.java:56) at $ServletRequestServicer_10b756c779b.service($ServletRequestServicer_10b756c779b.java) at org.apache.tapestry.request.DecodedRequestInjector.service( DecodedRequestInjector.java:55) at
@Meta doesn't allow different template extension
I expected that adding this annotation would allow me to name the template Foo.xml instead of Foo.html: @Meta(org.apache.tapestry.template-extension=xml) public class Foo extends BasePage { ... } However, when I do this, Tapestry gives a PageNotFoundException. It looks like it never finds the class to find the annotation in the first place. Am I missing something stupid, or should I file this in JIRA? Cheers, Paul _ Piano music podcast: http://inthehands.com Other interesting stuff: http://innig.net - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: @Meta doesn't allow different template extension
switching the template requires an Asset with the name '$template'. Dunno how that's done with annotations though. Geoff On 5/28/06, Paul Cantrell [EMAIL PROTECTED] wrote: I expected that adding this annotation would allow me to name the template Foo.xml instead of Foo.html: @Meta(org.apache.tapestry.template-extension=xml) public class Foo extends BasePage { ... } However, when I do this, Tapestry gives a PageNotFoundException. It looks like it never finds the class to find the annotation in the first place. Am I missing something stupid, or should I file this in JIRA? Cheers, Paul _ Piano music podcast: http://inthehands.com Other interesting stuff: http://innig.net - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- The Spindle guy. http://spindle.sf.net Blog: http://jroller.com/page/glongman Other interests: http://www.squidoo.com/spaceelevator/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can't get Tapestry to work with UTF-8 encoding
in your .application file -Original Message- From: Galam [mailto:[EMAIL PROTECTED] Sent: Sunday, May 28, 2006 10:38 PM To: Tapestry users Subject: Re: Can't get Tapestry to work with UTF-8 encoding Hi Paul, Can you tell me where you specify the following options? DEFANGED_meta key=org.apache.tapestry.template-encoding value=utf-8/ I would like to give it a try. Also, where can I find a complete of DEFANGED_meta... keys for Tapestry 4? Thanks! Galam. On 5/28/06, Paul Cantrell [EMAIL PROTECTED] wrote: This option works for me: DEFANGED_meta key=org.apache.tapestry.template-encoding value=utf-8/ This has the advantage that you don't need control over the startup params of the container's JVM. P - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]