tag:blogger.com,1999:blog-18772002.post6295079141798359250..comments2023-12-06T19:00:46.094+00:00Comments on OSGi Blog: OSGi and HibernateJürgen Alberthttp://www.blogger.com/profile/02725834158183495837noreply@blogger.comBlogger10125tag:blogger.com,1999:blog-18772002.post-57395022876596678422012-05-24T04:55:05.497+00:002012-05-24T04:55:05.497+00:00Hi Cameron,
EclipseLink is good but it is stick t...Hi Cameron,<br /><br />EclipseLink is good but it is stick to the Equinox implementation, for example, to load model classes from different bundles I have to use org.eclipse.osgi.internal.composite.CompositeClassLoader which is inside the framework implementation (org.eclipse.osgi) !!!<br /><br />I don't know alternative solutions yet.. Do you have advise for this ?<br /><br />Kind regards,<Anonymoushttps://www.blogger.com/profile/12353938970596494759noreply@blogger.comtag:blogger.com,1999:blog-18772002.post-78643539372091553022008-05-15T00:05:00.000+00:002008-05-15T00:05:00.000+00:00Hi Peter and others,I have implemented a sample OS...Hi Peter and others,<BR/><BR/>I have implemented a sample OSGi/Hibernate/Spring DM/Spring project loosely based on the pattern described above. I'm not using the extender model yet, but the Hibernate SessionFactory is dynamically updated as bundles are started and stopped.<BR/><BR/>The project is described here:<BR/><BR/>http://code.google.com/p/voluble/wiki/OsgiHibernateSpringSpringDMSample<BR/Loedolffhttps://www.blogger.com/profile/10188508983530736619noreply@blogger.comtag:blogger.com,1999:blog-18772002.post-81529146264748792042007-12-22T14:43:00.000+00:002007-12-22T14:43:00.000+00:00Hi Peter,I have been working with Apache felix + A...Hi Peter,<BR/><BR/>I have been working with Apache felix + Apache Cayenne for the past few months. Regarding your various concerns, I am certain that Apache Cayenne should serve your purpose.<BR/><BR/>Otherwise, GPL db40 will work fine too.<BR/><BR/>Regards,<BR/>James YongJames Yonghttps://www.blogger.com/profile/17948480952014446748noreply@blogger.comtag:blogger.com,1999:blog-18772002.post-53111073234055134742007-06-22T06:33:00.000+00:002007-06-22T06:33:00.000+00:00The easiest solution is to return a proxy to the H...The easiest solution is to return a proxy to the Hibernate SessionFactory and then count the number of sessions you hand out and get back. It is a solvable problem I think.<BR/><BR/>Kind regards,<BR/><BR/> Peter KriensPeter Krienshttps://www.blogger.com/profile/11373850803487010328noreply@blogger.comtag:blogger.com,1999:blog-18772002.post-81007304138254492582007-06-21T18:27:00.000+00:002007-06-21T18:27:00.000+00:00Yes, it's the issue of the garbage collection of t...Yes, it's the issue of the garbage collection of the SessionFactory that I'm raising. The Javadoc for SessionFactory.close() states:<BR/><BR/><I><BR/>Destroy this SessionFactory and release all resources (caches, connection pools, etc). It is the responsibility of the application to ensure that there are no open Sessions before calling close().<BR/></I><BR/><BR/>Hence, calling close() could Unknownhttps://www.blogger.com/profile/10841330371289978439noreply@blogger.comtag:blogger.com,1999:blog-18772002.post-58958170607793839012007-06-21T08:42:00.000+00:002007-06-21T08:42:00.000+00:00I think it is no problem that existing sessions ar...I think it is no problem that existing sessions are continue to be used. If they could use the session a micro session before, they can use it a microsecond after the configuration changed. Hibernate specifically indicates that sessions are relatively cheap entities that should be used on the level of a web request or other high level "request" concepts.<BR/><BR/>This of course leaves the problemPeter Krienshttps://www.blogger.com/profile/11373850803487010328noreply@blogger.comtag:blogger.com,1999:blog-18772002.post-19938590939375584352007-06-20T20:49:00.000+00:002007-06-20T20:49:00.000+00:00Hi Peter,Thanks for an excellent article. In your...Hi Peter,<BR/>Thanks for an excellent article. <BR/><BR/>In your comment you said,<BR/><I>2. Fresh session. Well, what I meant it gets the "current" fresh session. You actually get a fresh SessionFactory when the underlying configuration or contributions are changed.</I><BR/><BR/>Since, SessionFactory objects are immutable you must be building a new one. How did you ensure the existing Unknownhttps://www.blogger.com/profile/10841330371289978439noreply@blogger.comtag:blogger.com,1999:blog-18772002.post-40361701125560790902007-06-07T04:45:00.000+00:002007-06-07T04:45:00.000+00:00Hi Peter,I'm glad smart people like you are trying...Hi Peter,<BR/>I'm glad smart people like you are trying to figure out how to get libraries like Hibernate to work with OSGi. A similar tool is Oracle Toplink which may become a part of an Eclipse project named EclipseLink. They wish to build on top of OSGi. You can find out more here:<BR/>http://www.eclipse.org/proposals/eclipselink/<BR/><BR/>cheers,<BR/>CameronCameron Taggarthttps://www.blogger.com/profile/06064922381546110404noreply@blogger.comtag:blogger.com,1999:blog-18772002.post-29129042896493042832007-06-05T15:13:00.000+00:002007-06-05T15:13:00.000+00:001. This is a standard security issue and the langu...1. This is a standard security issue and the language is irrelevant. Input validation and escaping are crucial in all cases.<BR/><BR/>2. Fresh session. Well, what I meant it gets the "current" fresh session. You actually get a fresh SessionFactory when the underlying configuration or contributions are changed. Obviously, all participants in the transaction must share the same session or things Peter Krienshttps://www.blogger.com/profile/11373850803487010328noreply@blogger.comtag:blogger.com,1999:blog-18772002.post-34240845323035546132007-06-05T14:29:00.000+00:002007-06-05T14:29:00.000+00:00Hi Peter, Thanks for articulating your design so ...Hi Peter,<BR/> Thanks for articulating your design so clearly. Always interesting to see what others are doing with the technology. Some points to raise:<BR/><BR/>1. Security would concern me about the possibility of invoking any Goovy method from a URI typed in a web browser. Large scale systems developed by many people will likely have some code (that manipulates the DB) that I would not like Mike Kanaleyhttps://www.blogger.com/profile/05852542746096591287noreply@blogger.com