tag:blogger.com,1999:blog-2358827136496259563.post8724570395214334270..comments2024-03-22T00:01:05.070-07:00Comments on Granite Data Services Blog: GraniteDS Tide for SpringFranck Wolffhttp://www.blogger.com/profile/13374151179562356369noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-2358827136496259563.post-53103782217901848302012-10-27T00:20:13.216-07:002012-10-27T00:20:13.216-07:00I truly like to reading your post. Thank you so mu...I truly like to reading your post. Thank you so much for taking the time to share such a nice information.Anonymoushttps://www.blogger.com/profile/15298734367546838271noreply@blogger.comtag:blogger.com,1999:blog-2358827136496259563.post-89364546956197957422008-12-11T04:57:00.000-08:002008-12-11T04:57:00.000-08:00The reason is explained in the comments of this pa...The reason is explained in the comments of this page :<BR/><BR/>http://blog.springsource.com/2007/06/26/so-should-you-still-use-springs-hibernatetemplate-andor-jpatemplate/<BR/><BR/>And more precisely, the comment made by Juergen Hoeller : <BR/><BR/><I>Actually, "sessionFactory.getCurrentSession()" will throw an exception when called outside of a managed scope (i.e. in case of no thread-bound Session management being active). So that style can effectively only be used within a transaction and/or an active OpenSessionInViewFilter/Interceptor. This is equivalent to HibernateTemplate's "allowCreate=false" behavior.</I><BR/><BR/><BR/>I did a quick and dirty (no comments on the sysout and catch Exception :-) ) workaround to be able to go further in my testing. <BR/>I chandeg this in the source of the HibernateSessionManager (tide-hibernate).<BR/><BR/>This is probably not the right way, but it's okay for my testing purposes.<BR/>(suggestions on the best practices are welcome, especially if there's a clean way to make it work with the transaction manager managed by Spring which manages Hibernate's session).<BR/><BR/>public HibernateSessionManager(SessionFactory sf) {<BR/> try {<BR/> this.session = sf.getCurrentSession();<BR/> }<BR/> catch (Exception e) {<BR/> System.out.println("No hibernate session found - requesting new one");<BR/> this.session = sf.openSession();<BR/> }<BR/> }Anonymoushttps://www.blogger.com/profile/03166667200427160118noreply@blogger.comtag:blogger.com,1999:blog-2358827136496259563.post-14137900440309696482008-12-10T10:45:00.000-08:002008-12-10T10:45:00.000-08:00I encountered the following error : Context initia...I encountered the following error :<BR/><BR/> Context initialization failed<BR/>org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tidePersistenceManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.granite.tide.hibernate.HibernateSessionManager]: Constructor threw exception; nested exception is org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here<BR/><BR/><BR/>Isn't it related to the transaction manager which is bypassed ? <BR/><BR/>I'm using Spring 2.5.6 with annotation based config for spring and hibernateAnonymoushttps://www.blogger.com/profile/03166667200427160118noreply@blogger.comtag:blogger.com,1999:blog-2358827136496259563.post-51339405968596331692008-11-25T03:55:00.000-08:002008-11-25T03:55:00.000-08:00The second mistake isn't fixed in the article. And...The second mistake isn't fixed in the article. <BR/>And any solution of hard access of the blog for Chinese users? The domain blogspot is blocked in daytime in China. Is it possible for this blog access with a domain www.graniteds.org/blog? Maybe it should help.Setohttps://www.blogger.com/profile/16597908203482761925noreply@blogger.comtag:blogger.com,1999:blog-2358827136496259563.post-48216176022699687142008-11-25T02:14:00.000-08:002008-11-25T02:14:00.000-08:00Thanks for the remark. It's fixed.Thanks for the remark. It's fixed.William Draïhttps://www.blogger.com/profile/10006377637158687724noreply@blogger.comtag:blogger.com,1999:blog-2358827136496259563.post-88751766427832574802008-11-24T10:14:00.000-08:002008-11-24T10:14:00.000-08:00tideContext.personsBean.findPersons(findPersonsRes...tideContext.personsBean.findPersons(findPersonsResult);<BR/><BR/>Here should be findAllPersons instead? And ther result handler change a name? Is it a mistake?<BR/><BR/> // Triggers the remote call of the 'helloAction' component tideContext.helloAction.sayHello("Jimi", resultHandler); <BR/><BR/>And here should be helloBean instead? A mistake again?Setohttps://www.blogger.com/profile/16597908203482761925noreply@blogger.com