Cache is enabled on each hbm mapping of each entity. Carlos Bernard Sirius wrote: OK, the classnotFoundErrors apparently came from the fact that suddenly the datasource is configured in a separate xml applicationContext-datasource.xml. I had to copy/paste the datasource fragment to make it work again.Here's what I have put in mda's project.xml: <hibernateProxy>true</hibernateProxy> <hibernateMaxFetchDepth>1</hibernateMaxFetchDepth> that generates the following regarding hibernate in applicationContext.xml: <property name="hibernateProperties"> <props> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.dialect">net.sf.hibernate.dialect.MySQLDialect</prop> <prop key="hibernate.max_fetch_depth">1</prop> <prop key="hibernate.cache.use_query_cache">false</prop> <prop key="hibernate.cache.provider_class">net.sf.hibernate.cache.EhCacheProvider</prop> <prop key="hibernate.cache.query_cache_factory">net.sf.hibernate.cache.StandardQueryCacheFactory</prop> </props> </property> which shows that the max_fetch_depth is working, but I have no clue wether the proxies are now enabled. (I am a bit nervous: I have a very important demo tonight; everything works, but because of this "cascading query" problem, everything is now unacceptably slow...) bernardThis is very strange, since I am using them in all my proyects and it works perfectly. Which Andromda version are you using? Carlos Bernard Sirius wrote:Hi Carlos, I followed your advice, but now that proxies are enabled I get a very strange NoClassDefFoundError, without a stack trace: BUILD FAILED File...... C:\Documents andSettings\Candide\.maven\cache\maven-test-plugin-1.6.2\plugin.jelly Element... junit Line...... 133 Column.... 41 java.lang.NoClassDefFoundError Total time: 7 seconds Finished at: Fri Mar 04 15:26:43 GMT+01:00 2005 Besides, that doesn't explain the fact thatone-2-onerelations become many-to-one... bernard --- Carlos Cuenca <[EMAIL PROTECTED]> wrote:Hi Bernard, to get rid of all those outer joins when creatingasimple query, just turn on the hibernate proxies. Namespace property "hibernateProxy=true" Carlos Bernard Sirius wrote:Hi! Again, I have this problem with hibernate: asimplequery generates an incredible amount of SQL. Iwasthinking that specifying outer-join="false" would solve this, but it doesn't as you probably guess. I can't figure out how to tell hibernate NOT to eagerly load relations. It seems to be completely ignorant of the "lazy=true" attribute. Now that I've set outer-join="auto", which is AndroMDA's default, I have hibernate complainthat"MySQL can only use 31 tables in a join", whichisdocumented in their faq (http://hibernate.bluemars.net/117.html#A29). So, as a last resort, as is stated there, I'dliketotry setting max_fetch_depth to 1 or 2, only Idon'tknow how to let AndroMDA specify that. Of course please let me know if you have other suggestions bernard PS: the hibernate query: String query = "SELECT person FROM fractals.psychos.core.ontology.entity.PersonImpl"+"person LEFT JOINperson.propertiesas property WHERE " + "property.predicate=:pred"; the generated SQL: Hibernate: select userimpl0_.ID as ID, userimpl0_.USERNAME as USERNAME, userimpl 0_.PASSWORD as PASSWORD, userimpl0_.TIMESTAMP as TIMESTAMP, userimpl0_.PERSON_FK as PERSON_FK, userimpl0_.THUMBNAIL_FK asTHUMBNAI6_,userimpl0_.ROLODEX_FK as R OLODEX_FK, userimpl0_.CALENDAR_FK as CALENDAR8_fromUSER userimpl0_ left outer join PERSON personimpl1_ on userimpl0_.PERSON_FK=personimpl1_.ID left outerjoinPROPERTY properties2_ on personimpl1_.ID=properties2_.RESOURCE_FK leftouterjoin ABSTRACT_OBJECT properties2__1_ on properties2_.ID=properties2__1_.ID left ou ter join RESOURCE properties2__2_ on properties2_.ID=properties2__2_.ID where (p roperties2_.PREDICATE=? ) Hibernate: select personimpl0_.ID as ID10_, personimpl0_.FIRSTNAME as FIRSTNAME1 3_10_, personimpl0_.LASTNAME as LASTNAME13_10_, personimpl0_.BIRTHDATE as BIRTHD ATE13_10_, personimpl0_.MIDDLE_NAME as MIDDLE_N5_13_10_, personimpl0_.EMAIL as E MAIL13_10_, personimpl0_.PHONE as PHONE13_10_, personimpl0_.MOBILE as MOBILE13_1 0_, personimpl0_.WORK_PHONE as WORK_PHONE13_10_, personimpl0_.PERSONAL_EMAIL as PERSONA10_13_10_, personimpl0_.ICQ_NUMBER as ICQ_NUMBER13_10_, personimpl0_.MSN_ ID as MSN_ID13_10_, personimpl0_.SKYPE_ID as SKYPE_ID13_10_, personimpl0_.SKYPE_ NUMBER as SKYPE_N14_13_10_, personimpl0_.FAX as FAX13_10_, personimpl0__2_.TIMES TAMP as TIMESTAMP0_10_,personimpl0__2_.CORE_M_D_FKasCORE_M_D3_0_10_, userimpl 1_.ID as ID0_, userimpl1_.USERNAME as USERNAME0_, userimpl1_.PASSWORD as PASSWOR D0_, userimpl1_.TIMESTAMP as TIMESTAMP0_, userimpl1_.PERSON_FK as PERSON_FK0_, u serimpl1_.THUMBNAIL_FK as THUMBNAI6_0_, userimpl1_.ROLODEX_FK as ROLODEX_FK0_, u serimpl1_.CALENDAR_FK as CALENDAR8_0_,imageimpl2_.IDas ID1_, imageimpl2__1_.ME DIA_PATH as MEDIA_PATH2_1_, imageimpl2__1_.ORIGINAL_MEDIA_PATH asORIGINAL3_2_1_, imageimpl2__1_.MEDIA_U_R_L as MEDIA_U_4_2_1_, imageimpl2__1_.IS_REMOTE as IS_R EMOTE2_1_, imageimpl2__3_.TIMESTAMP asTIMESTAMP0_1_,imageimpl2__3_.CORE_M_D_FK=== message truncated === __________________________________ Celebrate Yahoo!'s 10th Birthday! Yahoo! Netrospective: 100 Moments of the Web http://birthday.yahoo.com/netrospective/ |
- Re: [Andromda-user] how to specify max_fetch_depth for hibe... Carlos Cuenca
- RE: [Andromda-user] how to specify max_fetch_depth for hibe... Chad Brandon
- Re: [Andromda-user] how to specify max_fetch_depth for hibe... Carlos Cuenca
- Re: [Andromda-user] how to specify max_fetch_depth for... Bernard Sirius
- Re: [Andromda-user] how to specify max_fetch_depth... Bernard Sirius
- RE: [Andromda-user] how to specify max_fetch_d... Chad Brandon
- Re: [Andromda-user] how to specify max_fetch_depth... Carlos Cuenca
- Re: [Andromda-user] how to specify max_fetch_d... Bernard Sirius
- RE: [Andromda-user] how to specify max_fetch_depth... Chad Brandon
- RE: [Andromda-user] how to specify max_fetch_depth for hibe... Chad Brandon
- Re: [Andromda-user] how to specify max_fetch_depth for hibe... Carlos Cuenca
- Re: [Andromda-user] how to specify max_fetch_depth for... Bernard Sirius
- Re: [Andromda-user] how to specify max_fetch_depth for hibe... Bernard Sirius
- Re: [Andromda-user] how to specify max_fetch_depth for hibe... Carlos Cuenca
- Re: [Andromda-user] how to specify max_fetch_depth for hibe... Carlos Cuenca
- Re: [Andromda-user] how to specify max_fetch_depth for hibe... Carlos Cuenca
- Re: [Andromda-user] how to specify max_fetch_depth for hibe... Carlos Cuenca
- Re: [Andromda-user] how to specify max_fetch_depth for hibe... Carlos Cuenca
- Re: [Andromda-user] how to specify max_fetch_depth for hibe... Carlos Cuenca