- This topic has 3 replies, 3 voices, and was last updated 19 years, 2 months ago by Riyad Kalla.
-
AuthorPosts
-
lchuenyaMemberHi,
I’m using Spring’s Hibernate support. Spring doesnt require hibernate.cfg.xml to be present. Therefore I’m not able to properly enable Hibernate capabilities for a project.Does it mean that I cannot use Hibernate capabilities in MyEclipse if I’m using Spring?
Riyad KallaMemberDoes it mean that I cannot use Hibernate capabilities in MyEclipse if I’m using Spring?
This may require some fudging. MyEclipse’s hibernate capabilities are not aware of Spring’s support for them, so it will generate the hibernate.cfg.xml file for you. You can of course merely ignore this file during runtime and let Spring handle the Hibernate configuration instead.
RandyMemberHi,
I’m not sure if this is related to the previous post, but it seems a reasonable place to start. If I try to set properties for my hibernate session in the applicationContext.xml, it does not get read. ie:<props> <prop key="hibernate.dialect"> org.hibernate.dialect.PostgreSQLDialect </prop> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.max_fetch_depth">3</prop> <prop key="hibernate.cglib.use_reflection_optimizer">false</prop> </props>
The one of interest is the cglib.use_reflextion_optimizer. This property is ignored (and so is the show_sql statement). If I have a hibernate.properties file in my classpath with this, I can set things so I can debug, etc. If I remove the hibernate properties, it complains about it, but the wierd thing is that it can still connect to the database (which makes me think it is reading at least part of this stuff from the applicationContext). The REALLY wierd thing is that the max_fetch_depth IS read properly.
Kinda bizzare. For now, I can get stuff done by having a hibernate.properties file with the tweeks in it, but I’m a bit curious about this.
TIA!
randy
Riyad KallaMemberRandy,
What version of HIbernate are you using? Are you using Spring to configure hibernate? Just an FYI: MYEclipse doesn’t do ANYTHING custom to any of the libs we ship, so there is no “MYEclipse Magic” happening here incase you were wondering. If you took this project and ran it using Notepad you’d get the same result most likely (unless there is a classpath issue with your application server connector or something like that). -
AuthorPosts