Announcement Announcement Module
Collapse
No announcement yet.
OpenSessionInViewFilter - LazyInitializationException Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • OpenSessionInViewFilter - LazyInitializationException

    Hey,

    Our app is using OpenSessionInViewFilter, HibernateTransactionManager, and HibernateDAOSupport. However, we still get LazyInitializationException when attempted to access a lazy collection. The exception is obvious, however, how do I enforced the session to be closed at the end of the request. From the logs, it is obvously not doing that.

    Below are my sample configurations:

    <bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSess ionFactoryBean">
    <property name="dataSource"><ref bean="dataSource"/></property>
    <property name="lobHandler">
    <ref local="oracleLobHandler"/>
    </property>
    <property name="mappingResources">
    <list>
    <value>....../A.hbm.xml</value> <value>......../B.hbm.xml</value>
    .................
    </list>
    </property>

    <property name="hibernateProperties">
    <props>
    <prop key="hibernate.dialect">net.sf.hibernate.dialect.O racle9Dialect</prop>
    <prop key="hibernate.show_sql">true</prop>
    <prop key="hibernate.use_outer_join">true</prop>
    <prop key="hibernate.cglib.use_reflection_optimizer">tru e</prop>
    </props>
    </property>

    </bean>

    <bean id="transactionManager" class="org.springframework.orm.hibernate.Hibernate TransactionManager" autowire="byName" depends-on="sessionFactory"/>


    <bean id="serviceTarget" class="com.sample.service.ServiceImpl">
    <property name="dao1"><ref bean="dao1"/></property>
    <property name="dao2"><ref bean="dao2"/></property>
    </bean>

    <bean id="service" class="org.springframework.transaction.interceptor .TransactionProxyFactoryBean">
    <property name="transactionManager"><ref bean="transactionManager"/></property>
    <property name="target"><ref local="serviceTarget"/></property>
    <property name="transactionAttributes">
    <props>
    <prop key="*">PROPAGATION_REQUIRED</prop>
    </property>
    </bean>


    All daos extens HibernateDAOSupport.

    In my action, the sample codes are as followed:

    service.insert(obj1);
    service.delete(ob2);
    Sample s = dao1.loadSample(new Long(121));
    log.warn("child size = " + s.getChild().size());

    When use the 'service' object to insert/update/delete, session is alway open and close by the end of the operation.

    after dao1.loadSample....................the session is closed at the end of the operation as well....

    [09/20/2004 10:25:12] DEBUG org.springframework.orm.hibernate.SessionFactoryUt ils: Closing Hibernate session
    [09/20/2004 10:25:12] DEBUG net.sf.hibernate.impl.SessionImpl: closing session
    [09/20/2004 10:25:12] DEBUG net.sf.hibernate.impl.SessionImpl: disconnecting session
    [09/20/2004 10:25:12] DEBUG net.sf.hibernate.impl.SessionImpl: transaction completion

    And therefore, when attempting to access a.getChild().size.....i got a LazyInitializationException.

    How do I configure spring to only close the session at the end of each request? Which I thought it's what OpenSessionInViewFilter is doing anyway. I even set flush mode of HibernateTempate to NEVER, hoping it would skip the close the method. But still no luck.

    Am I doing something wrong in configurationt to cause that error??

    Any help is greatly appreciated.

    Thanks,

  • #2
    OpenSessionInViewFilter is indeed an appropriate choice here. Are you sure that the filter is properly configured and kicks in for your particular request? Please double-check this: You should see corresponding debug log messages from OpenSessionInViewFilter.

    Juergen

    Comment


    • #3
      Juergen,

      Thanks for your prompt response.

      Are you sure that the filter is properly configured and kicks in for your particular request?
      Code:
        <filter>
      	<filter-name>hibernateSessionFilter</filter-name>
          <filter-class>org.springframework.orm.hibernate.support.OpenSessionInViewFilter</filter-class>
        </filter>
      
        <filter-mapping>
          <filter-name>hibernateSessionFilter</filter-name>
          <servlet-name>action</servlet-name>
        </filter-mapping>
      My test action code:

      Code:
      		Industry department = new Industry&#40;"Demo"&#41;;
      		log.warn&#40;"********************* before contentService insert *******************"&#41;;
      		contentService.insert&#40;department&#41;;
      		log.warn&#40;"********************* before contentService delete *******************"&#41;;
      		contentService.delete&#40;department&#41;;
      		log.warn&#40;"********************* after contentService delete *********************"&#41;;
      
      		log.warn&#40;"********************* befor service load *********************"&#41;;
      		Article b = contentService.getArticle&#40;new Long&#40;7321&#41;&#41;;
      		log.warn&#40;"********************* after service load *********************"&#41;;
      		log.warn&#40;"photo size = " + b.getPhotos&#40;&#41;.size&#40;&#41;&#41;;
      
      
      		log.warn&#40;"********************* befor articleDAO load *********************"&#41;;
      		Article a = articleDAO.loadArticle&#40;new Long&#40;7321&#41;&#41;;
      		log.warn&#40;"********************* after articleDAO load *********************"&#41;;
      		log.warn&#40;"photo size = " + a.getPhotos&#40;&#41;.size&#40;&#41;&#41;;
      Logs for each segment:

      contentService.delete(department);
      Code:
      &#91;09/20/2004 14&#58;37&#58;20&#93; WARN com.amg.wwd.action.SpringDemoAction&#58; ********************* before contentService delete *******************
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG org.springframework.transaction.interceptor.TransactionInterceptor&#58; Getting transaction for method 'delete' in class &#91;com.amg.wwd.service.content.ContentService&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG org.springframework.transaction.support.TransactionSynchronizationManager&#58; Retrieved value &#91;org.springframework.orm.hibernate.SessionHolder@2583017f&#93; for key &#91;net.sf.hibernate.impl.SessionFactoryImpl@4bd4c145&#93; bound to thread &#91;Servlet.Engine.Transports &#58; 0&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG org.springframework.orm.hibernate.HibernateTransactionManager&#58; Found thread-bound session &#91;net.sf.hibernate.impl.SessionImpl@3be3c17f&#93; for Hibernate transaction
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG org.springframework.orm.hibernate.HibernateTransactionManager&#58; Using transaction object &#91;[email protected]817e&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG org.springframework.orm.hibernate.HibernateTransactionManager&#58; Creating new transaction
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.transaction.JDBCTransaction&#58; begin
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.transaction.JDBCTransaction&#58; current autocommit status&#58;true
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.transaction.JDBCTransaction&#58; disabling autocommit
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG org.springframework.orm.hibernate.HibernateTransactionManager&#58; Exposing Hibernate transaction as JDBC transaction &#91;com.ibm.ws.rsadapter.jdbc.WSJdbcConnection@14f4417f&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG org.springframework.transaction.support.TransactionSynchronizationManager&#58; Bound value &#91;org.springframework.jdbc.datasource.ConnectionHolder@443f817e&#93; for key &#91;com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource@7d814147&#93; to thread &#91;Servlet.Engine.Transports &#58; 0&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG org.springframework.transaction.support.TransactionSynchronizationManager&#58; Initializing transaction synchronization
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG org.springframework.transaction.support.TransactionSynchronizationManager&#58; Retrieved value &#91;org.springframework.orm.hibernate.SessionHolder@2583017f&#93; for key &#91;net.sf.hibernate.impl.SessionFactoryImpl@4bd4c145&#93; bound to thread &#91;Servlet.Engine.Transports &#58; 0&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; deleting a persistent instance
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; deleting &#91;com.amg.wwd.domain.contentTag.Industry#263&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG org.springframework.transaction.support.TransactionSynchronizationManager&#58; Retrieved value &#91;org.springframework.orm.hibernate.SessionHolder@2583017f&#93; for key &#91;net.sf.hibernate.impl.SessionFactoryImpl@4bd4c145&#93; bound to thread &#91;Servlet.Engine.Transports &#58; 0&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG org.springframework.transaction.interceptor.TransactionInterceptor&#58; Invoking commit for transaction on method 'delete' in class &#91;com.amg.wwd.service.content.ContentService&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG org.springframework.orm.hibernate.HibernateTransactionManager&#58; Triggering beforeCommit synchronization
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG org.springframework.orm.hibernate.HibernateTransactionManager&#58; Triggering beforeCompletion synchronization
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG org.springframework.orm.hibernate.HibernateTransactionManager&#58; Initiating transaction commit
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG org.springframework.orm.hibernate.HibernateTransactionManager&#58; Committing Hibernate transaction on session &#91;net.sf.hibernate.impl.SessionImpl@3be3c17f&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.transaction.JDBCTransaction&#58; commit
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; flushing session
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; Flushing entities and processing referenced collections
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; Processing unreferenced collections
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; Scheduling collection removes/&#40;re&#41;creates/updates
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; Flushed&#58; 0 insertions, 0 updates, 1 deletions to 1 objects
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; Flushed&#58; 0 &#40;re&#41;creations, 0 updates, 0 removals to 0 collections
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.Printer&#58; listing entities&#58;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.Printer&#58; com.amg.wwd.domain.contentTag.Industry&#123;name=Demo, accountType=null, id=263&#125;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; executing flush
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.persister.NormalizedEntityPersister&#58; Deleting entity&#58; &#91;com.amg.wwd.domain.contentTag.Industry#263&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.BatcherImpl&#58; about to open&#58; 0 open PreparedStatements, 0 open ResultSets
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.SQL&#58; delete from content_tag where tag_id=?
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.BatcherImpl&#58; preparing statement
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.BatcherImpl&#58; about to open&#58; 1 open PreparedStatements, 0 open ResultSets
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.SQL&#58; delete from industry where tag_id=?
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.BatcherImpl&#58; preparing statement
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.type.LongType&#58; binding '263' to parameter&#58; 1
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.type.LongType&#58; binding '263' to parameter&#58; 1
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.BatcherImpl&#58; done closing&#58; 1 open PreparedStatements, 0 open ResultSets
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.BatcherImpl&#58; closing statement
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.BatcherImpl&#58; done closing&#58; 0 open PreparedStatements, 0 open ResultSets
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.BatcherImpl&#58; closing statement
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; post flush
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; transaction completion
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.transaction.JDBCTransaction&#58; re-enabling autocommit
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG org.springframework.orm.hibernate.HibernateTransactionManager&#58; Triggering afterCompletion synchronization
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG org.springframework.transaction.support.TransactionSynchronizationManager&#58; Clearing transaction synchronization
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG org.springframework.transaction.support.TransactionSynchronizationManager&#58; Removed value &#91;org.springframework.jdbc.datasource.ConnectionHolder@443f817e&#93; for key &#91;com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource@7d814147&#93; from thread &#91;Servlet.Engine.Transports &#58; 0&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG org.springframework.orm.hibernate.HibernateTransactionManager&#58; Not closing pre-bound Hibernate session &#91;net.sf.hibernate.impl.SessionImpl@3be3c17f&#93; after transaction
      &#91;09/20/2004 14&#58;37&#58;20&#93; WARN com.amg.wwd.action.SpringDemoAction&#58; ********************* after contentService delete *********************
      Article b = contentService.getArticle(new Long(7321));
      Code:
      &#91;09/20/2004 14&#58;37&#58;20&#93; WARN com.amg.wwd.action.SpringDemoAction&#58; ********************* befor service load *********************
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG org.springframework.transaction.interceptor.TransactionInterceptor&#58; Getting transaction for method 'getArticle' in class &#91;com.amg.wwd.service.content.ContentService&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG org.springframework.transaction.support.TransactionSynchronizationManager&#58; Retrieved value &#91;org.springframework.orm.hibernate.SessionHolder@2583017f&#93; for key &#91;net.sf.hibernate.impl.SessionFactoryImpl@4bd4c145&#93; bound to thread &#91;Servlet.Engine.Transports &#58; 0&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG org.springframework.orm.hibernate.HibernateTransactionManager&#58; Found thread-bound session &#91;net.sf.hibernate.impl.SessionImpl@3be3c17f&#93; for Hibernate transaction
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG org.springframework.orm.hibernate.HibernateTransactionManager&#58; Using transaction object &#91;[email protected]17e&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG org.springframework.orm.hibernate.HibernateTransactionManager&#58; Creating new transaction
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.transaction.JDBCTransaction&#58; begin
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.transaction.JDBCTransaction&#58; current autocommit status&#58;true
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.transaction.JDBCTransaction&#58; disabling autocommit
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG org.springframework.orm.hibernate.HibernateTransactionManager&#58; Exposing Hibernate transaction as JDBC transaction &#91;com.ibm.ws.rsadapter.jdbc.WSJdbcConnection@14f4417f&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG org.springframework.transaction.support.TransactionSynchronizationManager&#58; Bound value &#91;org.springframework.jdbc.datasource.ConnectionHolder@3e40017e&#93; for key &#91;com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource@7d814147&#93; to thread &#91;Servlet.Engine.Transports &#58; 0&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG org.springframework.transaction.support.TransactionSynchronizationManager&#58; Initializing transaction synchronization
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG org.springframework.transaction.support.TransactionSynchronizationManager&#58; Retrieved value &#91;org.springframework.orm.hibernate.SessionHolder@2583017f&#93; for key &#91;net.sf.hibernate.impl.SessionFactoryImpl@4bd4c145&#93; bound to thread &#91;Servlet.Engine.Transports &#58; 0&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; loading &#91;com.amg.wwd.domain.content.Article#7321&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; attempting to resolve &#91;com.amg.wwd.domain.content.Article#7321&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; object not resolved in any cache &#91;com.amg.wwd.domain.content.Article#7321&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.persister.NormalizedEntityPersister&#58; Materializing entity&#58; &#91;com.amg.wwd.domain.content.Article#7321&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.BatcherImpl&#58; about to open&#58; 0 open PreparedStatements, 0 open ResultSets
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.SQL&#58; select article0_.content_id as content_id4_, case when article0__2_.content_id is not null then 1 when article0__3_.content_id is not null then 2 when article0__4_.content_id is not null then 3 when article0_.content_id is not null then 0 end as clazz_4_, article0_.headline as headline2_4_, article0_.headline_desc as headline3_2_4_, article0_.byline as byline2_4_, article0_.body_copy as body_copy2_4_, article0_.page_number as page_num6_2_4_, article0_.corrections as correcti7_2_4_, article0_.show_corrections as show_cor8_2_4_, article0_.article_type as article_9_2_4_, article0__1_.publish_date as publish_2_0_4_, article0__1_.archive_date as archive_3_0_4_, article0__1_.account_type_change_date as account_4_0_4_, article0__1_.last_updated_date as last_upd5_0_4_, article0__1_.received_date as received6_0_4_, article0__1_.sequence_num as sequence7_0_4_, article0__1_.group_tag_id as group_ta8_0_4_, article0__1_.account_type_id as account_9_0_4_, article0__1_.account_type_id_update as account10_0_4_, article0__2_.display_type as display_2_5_4_, article0__2_.single_credit_only as single_c3_5_4_, article0__2_.single_credit_name as single_c4_5_4_, article0__3_.teaser as teaser6_4_, article0__4_.subject as subject7_4_, contenttag1_.tag_id as tag_id0_, case when contenttag1__1_.tag_id is not null then 1 when contenttag1__2_.tag_id is not null then 2 when contenttag1__3_.tag_id is not null then 3 when contenttag1_.tag_id is not null then 0 end as clazz_0_, contenttag1_.account_type_id as account_2_11_0_, contenttag1__1_.name as name12_0_, contenttag1__1_.url as url12_0_, contenttag1__1_.address as address12_0_, contenttag1__1_.city as city12_0_, contenttag1__1_.state as state12_0_, contenttag1__1_.zip_code as zip_code12_0_, contenttag1__1_.country as country12_0_, contenttag1__1_.phone as phone12_0_, contenttag1__2_.name as name13_0_, contenttag1__3_.first_name as first_name14_0_, contenttag1__3_.last_name as last_name14_0_, contenttag1__3_.email as email14_0_, contenttag1__3_.is_author as is_author14_0_, accounttyp2_.account_type_id as account_1_1_, accounttyp2_.name as name1_, accounttyp2_.access_level as access_l3_1_, accounttyp3_.account_type_id as account_1_2_, accounttyp3_.name as name2_, accounttyp3_.access_level as access_l3_2_, accounttyp4_.account_type_id as account_1_3_, accounttyp4_.name as name3_, accounttyp4_.access_level as access_l3_3_ from article article0_ inner join content article0__1_ on article0_.content_id=article0__1_.content_id left outer join photo_spread article0__2_ on article0_.content_id=article0__2_.content_id left outer join breaking_news article0__3_ on article0_.content_id=article0__3_.content_id left outer join q_and_a article0__4_ on article0_.content_id=article0__4_.content_id left outer join content_tag contenttag1_ on article0__1_.group_tag_id=contenttag1_.tag_id left outer join company contenttag1__1_ on contenttag1_.tag_id=contenttag1__1_.tag_id left outer join industry contenttag1__2_ on contenttag1_.tag_id=contenttag1__2_.tag_id left outer join people contenttag1__3_ on contenttag1_.tag_id=contenttag1__3_.tag_id left outer join account_type accounttyp2_ on contenttag1_.account_type_id=accounttyp2_.account_type_id left outer join account_type accounttyp3_ on article0__1_.account_type_id=accounttyp3_.account_type_id left outer join account_type accounttyp4_ on article0__1_.account_type_id_update=accounttyp4_.account_type_id where article0_.content_id=?
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.BatcherImpl&#58; preparing statement
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.type.LongType&#58; binding '7321' to parameter&#58; 1
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.loader.Loader&#58; processing result set
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.type.LongType&#58; returning null as column&#58; tag_id0_
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.type.LongType&#58; returning null as column&#58; account_1_1_
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.type.LongType&#58; returning '5' as column&#58; account_1_2_
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.type.LongType&#58; returning null as column&#58; account_1_3_
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.loader.Loader&#58; result row&#58; null, null, 5, null, 7321
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.loader.Loader&#58; Initializing object from ResultSet&#58; 5
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.loader.Loader&#58; Hydrating entity&#58; com.amg.wwd.domain.type.AccountType#5
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.type.StringType&#58; returning 'Archive' as column&#58; name2_
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.type.IntegerType&#58; returning '5' as column&#58; access_l3_2_
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.type.IntegerType&#58; returning '0' as column&#58; clazz_4_
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.loader.Loader&#58; Initializing object from ResultSet&#58; 7321
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.loader.Loader&#58; Hydrating entity&#58; com.amg.wwd.domain.content.Article#7321
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.type.StringType&#58; returning 'DKNY?s New York Stories                                                                                                                                                                                                                                        ' as column&#58; headline2_4_
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.type.StringType&#58; returning 'Donna Karan is bringing her ?New York Stories? to the big screen, producing a short film for her DKNY label directed by Steven Sebring.' as column&#58; headline3_2_4_
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.type.StringType&#58; returning 'Lisa Lockwood' as column&#58; byline2_4_
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.type.StringType&#58; returning '6' as column&#58; page_num6_2_4_
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.type.StringType&#58; returning null as column&#58; correcti7_2_4_
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.type.YesNoType&#58; returning null as column&#58; show_cor8_2_4_
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.type.StringType&#58; returning 'A' as column&#58; article_9_2_4_
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.type.TimestampType&#58; returning '13 June 2003 00&#58;00&#58;00' as column&#58; publish_2_0_4_
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.type.TimestampType&#58; returning '13 June 2003 00&#58;00&#58;00' as column&#58; archive_3_0_4_
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.type.TimestampType&#58; returning null as column&#58; account_4_0_4_
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.type.TimestampType&#58; returning null as column&#58; last_upd5_0_4_
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.type.TimestampType&#58; returning null as column&#58; received6_0_4_
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.type.IntegerType&#58; returning null as column&#58; sequence7_0_4_
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.type.LongType&#58; returning null as column&#58; group_ta8_0_4_
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.type.LongType&#58; returning '5' as column&#58; account_9_0_4_
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.type.LongType&#58; returning null as column&#58; account10_0_4_
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.loader.Loader&#58; done processing result set &#40;1 rows&#41;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.BatcherImpl&#58; done closing&#58; 0 open PreparedStatements, 0 open ResultSets
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.BatcherImpl&#58; closing statement
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.loader.Loader&#58; total objects hydrated&#58; 2
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; resolving associations for &#91;com.amg.wwd.domain.type.AccountType#5&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; done materializing entity &#91;com.amg.wwd.domain.type.AccountType#5&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; resolving associations for &#91;com.amg.wwd.domain.content.Article#7321&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; creating collection wrapper&#58;&#91;com.amg.wwd.domain.content.Article.quotes#7321&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; creating collection wrapper&#58;&#91;com.amg.wwd.domain.content.Article.files#7321&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; creating collection wrapper&#58;&#91;com.amg.wwd.domain.content.Article.photos#7321&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; creating collection wrapper&#58;&#91;com.amg.wwd.domain.content.Article.authors#7321&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; loading &#91;com.amg.wwd.domain.type.AccountType#5&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; attempting to resolve &#91;com.amg.wwd.domain.type.AccountType#5&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; resolved object in session cache &#91;com.amg.wwd.domain.type.AccountType#5&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; creating collection wrapper&#58;&#91;com.amg.wwd.domain.Content.companyTags#7321&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; creating collection wrapper&#58;&#91;com.amg.wwd.domain.Content.peopleTags#7321&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; creating collection wrapper&#58;&#91;com.amg.wwd.domain.Content.industryTags#7321&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; done materializing entity &#91;com.amg.wwd.domain.content.Article#7321&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; initializing non-lazy collections
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG org.springframework.transaction.support.TransactionSynchronizationManager&#58; Retrieved value &#91;org.springframework.orm.hibernate.SessionHolder@2583017f&#93; for key &#91;net.sf.hibernate.impl.SessionFactoryImpl@4bd4c145&#93; bound to thread &#91;Servlet.Engine.Transports &#58; 0&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG org.springframework.transaction.interceptor.TransactionInterceptor&#58; Invoking commit for transaction on method 'getArticle' in class &#91;com.amg.wwd.service.content.ContentService&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG org.springframework.orm.hibernate.HibernateTransactionManager&#58; Triggering beforeCommit synchronization
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG org.springframework.orm.hibernate.HibernateTransactionManager&#58; Triggering beforeCompletion synchronization
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG org.springframework.orm.hibernate.HibernateTransactionManager&#58; Initiating transaction commit
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG org.springframework.orm.hibernate.HibernateTransactionManager&#58; Committing Hibernate transaction on session &#91;net.sf.hibernate.impl.SessionImpl@3be3c17f&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.transaction.JDBCTransaction&#58; commit
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; flushing session
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.engine.Cascades&#58; processing cascades for&#58; com.amg.wwd.domain.content.Article
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.engine.Cascades&#58; cascading to collection&#58; com.amg.wwd.domain.content.Article.quotes
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.engine.Cascades&#58; cascading to collection&#58; com.amg.wwd.domain.content.Article.files
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.engine.Cascades&#58; cascading to collection&#58; com.amg.wwd.domain.content.Article.photos
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.engine.Cascades&#58; cascading to collection&#58; com.amg.wwd.domain.content.Article.authors
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.engine.Cascades&#58; done processing cascades for&#58; com.amg.wwd.domain.content.Article
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; Flushing entities and processing referenced collections
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; Collection found&#58; &#91;com.amg.wwd.domain.content.Article.quotes#7321&#93;, was&#58; &#91;com.amg.wwd.domain.content.Article.quotes#7321&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; Collection found&#58; &#91;com.amg.wwd.domain.content.Article.files#7321&#93;, was&#58; &#91;com.amg.wwd.domain.content.Article.files#7321&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; Collection found&#58; &#91;com.amg.wwd.domain.content.Article.photos#7321&#93;, was&#58; &#91;com.amg.wwd.domain.content.Article.photos#7321&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; Collection found&#58; &#91;com.amg.wwd.domain.content.Article.authors#7321&#93;, was&#58; &#91;com.amg.wwd.domain.content.Article.authors#7321&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; Collection found&#58; &#91;com.amg.wwd.domain.Content.companyTags#7321&#93;, was&#58; &#91;com.amg.wwd.domain.Content.companyTags#7321&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; Collection found&#58; &#91;com.amg.wwd.domain.Content.peopleTags#7321&#93;, was&#58; &#91;com.amg.wwd.domain.Content.peopleTags#7321&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; Collection found&#58; &#91;com.amg.wwd.domain.Content.industryTags#7321&#93;, was&#58; &#91;com.amg.wwd.domain.Content.industryTags#7321&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; Processing unreferenced collections
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; Scheduling collection removes/&#40;re&#41;creates/updates
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; Flushed&#58; 0 insertions, 0 updates, 0 deletions to 2 objects
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; Flushed&#58; 0 &#40;re&#41;creations, 0 updates, 0 removals to 7 collections
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.Printer&#58; listing entities&#58;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.Printer&#58; com.amg.wwd.domain.type.AccountType&#123;name=Archive, accessLevel=5, id=5&#125;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.Printer&#58; com.amg.wwd.domain.content.Article&#123;publishDate=13 June 2003 00&#58;00&#58;00, receivedDate=null, byline=Lisa Lockwood, accountTypeUpdate=null, showCorrections=null, headlineDesc=Donna Karan is bringing her ?New York Stories? to the big screen, producing a short film for her DKNY label directed by Steven Sebring., bodyCopy=NEW YORK ? Donna Karan as filmmaker?<br><br>Karan is bringing her ?New York Stories? to the big screen, producing a short film for her DKNY label directed by Steven Sebring. The film highlights fashions from the fall 2002 DKNY collection.<br><br>?I?m a frustrated producer and director,? said Karan in a telephone interview this week. ?I?ve done it in print. I?ve conjured up these movies in my head and wanted to do this for such a long time.?<br><br>The 18-minute film, with the tag line, ?A Little Film About a Big City,? features a day in the lives of three women ? an actress, writer and musician ? played, respectively, by Angela Lindvall, Sophie Dahl and Michele Hicks. The film also has cameo appearances by Sylvia Miles and Lauren Ezersky. The movie was shot in and around New York City and features skyline shots as well as the Chelsea Hotel and Madison Square Park.<br><br>The film is strictly a vehicle for the ad campaign and was created by Karan?s ad agency, Laird & Partners, here. With some interesting twists, the movie shows how the three women get ready for a movie audition, book signing and musical tour. It will be presented to the press next Thursday night and can be viewed on DKNY?s Web site and at boutiques worldwide. The company has 48 licensed and company-owned stores. <br><br>Karan said her fall DKNY collection especially inspired her to do a film.  Each of the models in the film wears multiple outfits and accessories from the fall DKNY collection. <br><br>?I never thought about my clothes. I always wanted people to see them in their real form. These are real clothes. It really captures the diversification of the spring line. The Donna Karan woman can be a downtown rock ?n? roll type, an intellectual or an actress. Hopefully, it?s about the creative spirit and creating your own look,? she said.<br><br>Patti Cohen, executive vice president of global marketing and communications for DKI, declined to divulge the fall media budget, but said it was up 10 percent. According to CMR, DKNY spent $15.9 million on media in the second half of 2002.<br><br>The film was shot digitally, and photos were downloaded to be used for the company?s fall ad campaign. The ads will run in several magazines, beginning in August, including W, Vogue, Vanity Fair, Glamour, Elle, Harper?s Bazaar and The New York Times Magazine. A 24-page outsert will be polybagged with the September Interview highlighting scenes from the movie, along with a copy of the movie on CD-ROM. The print images, which contain filmstrip borders, also will be used as wild postings in New York and Los Angeles., type=A, industryTags=uninitialized, accountType=AccountType#5, files=uninitialized, group=null, sequence=null, headline=DKNY?s New York Stories                                                                                                                                                                                                                                        , peopleTags=uninitialized, corrections=null, companyTags=uninitialized, archiveDate=13 June 2003 00&#58;00&#58;00, id=7321, quotes=uninitialized, accountTypeChangeDate=null, lastUpdatedDate=null, pageNumber=6, photos=uninitialized, authors=uninitialized&#125;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; executing flush
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; post flush
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; transaction completion
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.transaction.JDBCTransaction&#58; re-enabling autocommit
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG org.springframework.orm.hibernate.HibernateTransactionManager&#58; Triggering afterCompletion synchronization
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG org.springframework.transaction.support.TransactionSynchronizationManager&#58; Clearing transaction synchronization
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG org.springframework.transaction.support.TransactionSynchronizationManager&#58; Removed value &#91;org.springframework.jdbc.datasource.ConnectionHolder@3e40017e&#93; for key &#91;com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource@7d814147&#93; from thread &#91;Servlet.Engine.Transports &#58; 0&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG org.springframework.orm.hibernate.HibernateTransactionManager&#58; Not closing pre-bound Hibernate session &#91;net.sf.hibernate.impl.SessionImpl@3be3c17f&#93; after transaction
      &#91;09/20/2004 14&#58;37&#58;20&#93; WARN com.amg.wwd.action.SpringDemoAction&#58; ********************* after service load *********************
      Article a = articleDAO.loadArticle(new Long(7321));
      Code:
      &#91;09/20/2004 14&#58;37&#58;20&#93; WARN com.amg.wwd.action.SpringDemoAction&#58; ********************* befor articleDAO load *********************
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG org.springframework.orm.hibernate.SessionFactoryUtils&#58; Opening Hibernate session
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; opened session
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; loading &#91;com.amg.wwd.domain.content.Article#7321&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; attempting to resolve &#91;com.amg.wwd.domain.content.Article#7321&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; object not resolved in any cache &#91;com.amg.wwd.domain.content.Article#7321&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.persister.NormalizedEntityPersister&#58; Materializing entity&#58; &#91;com.amg.wwd.domain.content.Article#7321&#93;
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.BatcherImpl&#58; about to open&#58; 0 open PreparedStatements, 0 open ResultSets
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.SQL&#58; select article0_.content_id as content_id4_, case when article0__2_.content_id is not null then 1 when article0__3_.content_id is not null then 2 when article0__4_.content_id is not null then 3 when article0_.content_id is not null then 0 end as clazz_4_, article0_.headline as headline28_4_, article0_.headline_desc as headline3_28_4_, article0_.byline as byline28_4_, article0_.body_copy as body_copy28_4_, article0_.page_number as page_num6_28_4_, article0_.corrections as correcti7_28_4_, article0_.show_corrections as show_cor8_28_4_, article0_.article_type as article_9_28_4_, article0__1_.publish_date as publish_2_26_4_, article0__1_.archive_date as archive_3_26_4_, article0__1_.account_type_change_date as account_4_26_4_, article0__1_.last_updated_date as last_upd5_26_4_, article0__1_.received_date as received6_26_4_, article0__1_.sequence_num as sequence7_26_4_, article0__1_.group_tag_id as group_ta8_26_4_, article0__1_.account_type_id as account_9_26_4_, article0__1_.account_type_id_update as account10_26_4_, article0__2_.display_type as display_2_31_4_, article0__2_.single_credit_only as single_c3_31_4_, article0__2_.single_credit_name as single_c4_31_4_, article0__3_.teaser as teaser32_4_, article0__4_.subject as subject33_4_, contenttag1_.tag_id as tag_id0_, case when contenttag1__1_.tag_id is not null then 1 when contenttag1__2_.tag_id is not null then 2 when contenttag1__3_.tag_id is not null then 3 when contenttag1_.tag_id is not null then 0 end as clazz_0_, contenttag1_.account_type_id as account_2_37_0_, contenttag1__1_.name as name38_0_, contenttag1__1_.url as url38_0_, contenttag1__1_.address as address38_0_, contenttag1__1_.city as city38_0_, contenttag1__1_.state as state38_0_, contenttag1__1_.zip_code as zip_code38_0_, contenttag1__1_.country as country38_0_, contenttag1__1_.phone as phone38_0_, contenttag1__2_.name as name39_0_, contenttag1__3_.first_name as first_name40_0_, contenttag1__3_.last_name as last_name40_0_, contenttag1__3_.email as email40_0_, contenttag1__3_.is_author as is_author40_0_, accounttyp2_.account_type_id as account_1_1_, accounttyp2_.name as name1_, accounttyp2_.access_level as access_l3_1_, accounttyp3_.account_type_id as account_1_2_, accounttyp3_.name as name2_, accounttyp3_.access_level as access_l3_2_, accounttyp4_.account_type_id as account_1_3_, accounttyp4_.name as name3_, accounttyp4_.access_level as access_l3_3_ from article article0_ inner join content article0__1_ on article0_.content_id=article0__1_.content_id left outer join photo_spread article0__2_ on article0_.content_id=article0__2_.content_id left outer join breaking_news article0__3_ on article0_.content_id=article0__3_.content_id left outer join q_and_a article0__4_ on article0_.content_id=article0__4_.content_id left outer join content_tag contenttag1_ on article0__1_.group_tag_id=contenttag1_.tag_id left outer join company contenttag1__1_ on contenttag1_.tag_id=contenttag1__1_.tag_id left outer join industry contenttag1__2_ on contenttag1_.tag_id=contenttag1__2_.tag_id left outer join people contenttag1__3_ on contenttag1_.tag_id=contenttag1__3_.tag_id left outer join account_type accounttyp2_ on contenttag1_.account_type_id=accounttyp2_.account_type_id left outer join account_type accounttyp3_ on article0__1_.account_type_id=accounttyp3_.account_type_id left outer join account_type accounttyp4_ on article0__1_.account_type_id_update=accounttyp4_.account_type_id where article0_.content_id=?
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.impl.BatcherImpl&#58; preparing statement
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.type.LongType&#58; binding '7321' to parameter&#58; 1
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.loader.Loader&#58; processing result set
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.type.LongType&#58; returning null as column&#58; tag_id0_
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.type.LongType&#58; returning null as column&#58; account_1_1_
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.type.LongType&#58; returning '5' as column&#58; account_1_2_
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.type.LongType&#58; returning null as column&#58; account_1_3_
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.loader.Loader&#58; result row&#58; null, null, 5, null, 7321
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.loader.Loader&#58; Initializing object from ResultSet&#58; 5
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.loader.Loader&#58; Hydrating entity&#58; com.amg.wwd.domain.type.AccountType#5
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.type.StringType&#58; returning 'Archive' as column&#58; name2_
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.type.IntegerType&#58; returning '5' as column&#58; access_l3_2_
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.type.IntegerType&#58; returning '0' as column&#58; clazz_4_
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.loader.Loader&#58; Initializing object from ResultSet&#58; 7321
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.loader.Loader&#58; Hydrating entity&#58; com.amg.wwd.domain.content.Article#7321
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.type.StringType&#58; returning 'DKNY?s New York Stories                                                                                                                                                                                                                                        ' as column&#58; headline28_4_
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.type.StringType&#58; returning 'Donna Karan is bringing her ?New York Stories? to the big screen, producing a short film for her DKNY label directed by Steven Sebring.' as column&#58; headline3_28_4_
      &#91;09/20/2004 14&#58;37&#58;20&#93; DEBUG net.sf.hibernate.type.StringType&#58; returning 'Lisa Lockwood' as column&#58; byline28_4_
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.type.StringType&#58; returning '6' as column&#58; page_num6_28_4_
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.type.StringType&#58; returning null as column&#58; correcti7_28_4_
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.type.YesNoType&#58; returning null as column&#58; show_cor8_28_4_
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.type.StringType&#58; returning 'A' as column&#58; article_9_28_4_
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.type.TimestampType&#58; returning '13 June 2003 00&#58;00&#58;00' as column&#58; publish_2_26_4_
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.type.TimestampType&#58; returning '13 June 2003 00&#58;00&#58;00' as column&#58; archive_3_26_4_
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.type.TimestampType&#58; returning null as column&#58; account_4_26_4_
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.type.TimestampType&#58; returning null as column&#58; last_upd5_26_4_
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.type.TimestampType&#58; returning null as column&#58; received6_26_4_
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.type.IntegerType&#58; returning null as column&#58; sequence7_26_4_
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.type.LongType&#58; returning null as column&#58; group_ta8_26_4_
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.type.LongType&#58; returning '5' as column&#58; account_9_26_4_
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.type.LongType&#58; returning null as column&#58; account10_26_4_
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.loader.Loader&#58; done processing result set &#40;1 rows&#41;
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.impl.BatcherImpl&#58; done closing&#58; 0 open PreparedStatements, 0 open ResultSets
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.impl.BatcherImpl&#58; closing statement
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.loader.Loader&#58; total objects hydrated&#58; 2
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; resolving associations for &#91;com.amg.wwd.domain.type.AccountType#5&#93;
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; done materializing entity &#91;com.amg.wwd.domain.type.AccountType#5&#93;
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; resolving associations for &#91;com.amg.wwd.domain.content.Article#7321&#93;
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; creating collection wrapper&#58;&#91;com.amg.wwd.domain.content.Article.quotes#7321&#93;
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; creating collection wrapper&#58;&#91;com.amg.wwd.domain.content.Article.files#7321&#93;
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; creating collection wrapper&#58;&#91;com.amg.wwd.domain.content.Article.photos#7321&#93;
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; creating collection wrapper&#58;&#91;com.amg.wwd.domain.content.Article.authors#7321&#93;
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; loading &#91;com.amg.wwd.domain.type.AccountType#5&#93;
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; attempting to resolve &#91;com.amg.wwd.domain.type.AccountType#5&#93;
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; resolved object in session cache &#91;com.amg.wwd.domain.type.AccountType#5&#93;
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; creating collection wrapper&#58;&#91;com.amg.wwd.domain.Content.companyTags#7321&#93;
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; creating collection wrapper&#58;&#91;com.amg.wwd.domain.Content.peopleTags#7321&#93;
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; creating collection wrapper&#58;&#91;com.amg.wwd.domain.Content.industryTags#7321&#93;
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; done materializing entity &#91;com.amg.wwd.domain.content.Article#7321&#93;
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; initializing non-lazy collections
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG org.springframework.orm.hibernate.HibernateTemplate&#58; Eagerly flushing Hibernate session
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; flushing session
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.engine.Cascades&#58; processing cascades for&#58; com.amg.wwd.domain.content.Article
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.engine.Cascades&#58; cascading to collection&#58; com.amg.wwd.domain.content.Article.quotes
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.engine.Cascades&#58; cascading to collection&#58; com.amg.wwd.domain.content.Article.files
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.engine.Cascades&#58; cascading to collection&#58; com.amg.wwd.domain.content.Article.photos
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.engine.Cascades&#58; cascading to collection&#58; com.amg.wwd.domain.content.Article.authors
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.engine.Cascades&#58; done processing cascades for&#58; com.amg.wwd.domain.content.Article
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; Flushing entities and processing referenced collections
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; Collection found&#58; &#91;com.amg.wwd.domain.content.Article.quotes#7321&#93;, was&#58; &#91;com.amg.wwd.domain.content.Article.quotes#7321&#93;
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; Collection found&#58; &#91;com.amg.wwd.domain.content.Article.files#7321&#93;, was&#58; &#91;com.amg.wwd.domain.content.Article.files#7321&#93;
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; Collection found&#58; &#91;com.amg.wwd.domain.content.Article.photos#7321&#93;, was&#58; &#91;com.amg.wwd.domain.content.Article.photos#7321&#93;
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; Collection found&#58; &#91;com.amg.wwd.domain.content.Article.authors#7321&#93;, was&#58; &#91;com.amg.wwd.domain.content.Article.authors#7321&#93;
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; Collection found&#58; &#91;com.amg.wwd.domain.Content.companyTags#7321&#93;, was&#58; &#91;com.amg.wwd.domain.Content.companyTags#7321&#93;
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; Collection found&#58; &#91;com.amg.wwd.domain.Content.peopleTags#7321&#93;, was&#58; &#91;com.amg.wwd.domain.Content.peopleTags#7321&#93;
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; Collection found&#58; &#91;com.amg.wwd.domain.Content.industryTags#7321&#93;, was&#58; &#91;com.amg.wwd.domain.Content.industryTags#7321&#93;
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; Processing unreferenced collections
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; Scheduling collection removes/&#40;re&#41;creates/updates
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; Flushed&#58; 0 insertions, 0 updates, 0 deletions to 2 objects
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; Flushed&#58; 0 &#40;re&#41;creations, 0 updates, 0 removals to 7 collections
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.impl.Printer&#58; listing entities&#58;
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.impl.Printer&#58; com.amg.wwd.domain.type.AccountType&#123;name=Archive, accessLevel=5, id=5&#125;
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.impl.Printer&#58; com.amg.wwd.domain.content.Article&#123;publishDate=13 June 2003 00&#58;00&#58;00, receivedDate=null, byline=Lisa Lockwood, accountTypeUpdate=null, showCorrections=null, headlineDesc=Donna Karan is bringing her ?New York Stories? to the big screen, producing a short film for her DKNY label directed by Steven Sebring., bodyCopy=NEW YORK ? Donna Karan as filmmaker?<br><br>Karan is bringing her ?New York Stories? to the big screen, producing a short film for her DKNY label directed by Steven Sebring. The film highlights fashions from the fall 2002 DKNY collection.<br><br>?I?m a frustrated producer and director,? said Karan in a telephone interview this week. ?I?ve done it in print. I?ve conjured up these movies in my head and wanted to do this for such a long time.?<br><br>The 18-minute film, with the tag line, ?A Little Film About a Big City,? features a day in the lives of three women ? an actress, writer and musician ? played, respectively, by Angela Lindvall, Sophie Dahl and Michele Hicks. The film also has cameo appearances by Sylvia Miles and Lauren Ezersky. The movie was shot in and around New York City and features skyline shots as well as the Chelsea Hotel and Madison Square Park.<br><br>The film is strictly a vehicle for the ad campaign and was created by Karan?s ad agency, Laird & Partners, here. With some interesting twists, the movie shows how the three women get ready for a movie audition, book signing and musical tour. It will be presented to the press next Thursday night and can be viewed on DKNY?s Web site and at boutiques worldwide. The company has 48 licensed and company-owned stores. <br><br>Karan said her fall DKNY collection especially inspired her to do a film.  Each of the models in the film wears multiple outfits and accessories from the fall DKNY collection. <br><br>?I never thought about my clothes. I always wanted people to see them in their real form. These are real clothes. It really captures the diversification of the spring line. The Donna Karan woman can be a downtown rock ?n? roll type, an intellectual or an actress. Hopefully, it?s about the creative spirit and creating your own look,? she said.<br><br>Patti Cohen, executive vice president of global marketing and communications for DKI, declined to divulge the fall media budget, but said it was up 10 percent. According to CMR, DKNY spent $15.9 million on media in the second half of 2002.<br><br>The film was shot digitally, and photos were downloaded to be used for the company?s fall ad campaign. The ads will run in several magazines, beginning in August, including W, Vogue, Vanity Fair, Glamour, Elle, Harper?s Bazaar and The New York Times Magazine. A 24-page outsert will be polybagged with the September Interview highlighting scenes from the movie, along with a copy of the movie on CD-ROM. The print images, which contain filmstrip borders, also will be used as wild postings in New York and Los Angeles., type=A, industryTags=uninitialized, accountType=AccountType#5, files=uninitialized, group=null, sequence=null, headline=DKNY?s New York Stories                                                                                                                                                                                                                                        , peopleTags=uninitialized, corrections=null, companyTags=uninitialized, archiveDate=13 June 2003 00&#58;00&#58;00, id=7321, quotes=uninitialized, accountTypeChangeDate=null, lastUpdatedDate=null, pageNumber=6, photos=uninitialized, authors=uninitialized&#125;
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; executing flush
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; post flush
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG org.springframework.orm.hibernate.SessionFactoryUtils&#58; Closing Hibernate session
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; closing session
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; disconnecting session
      &#91;09/20/2004 14&#58;37&#58;21&#93; DEBUG net.sf.hibernate.impl.SessionImpl&#58; transaction completion
      &#91;09/20/2004 14&#58;37&#58;21&#93; WARN com.amg.wwd.action.SpringDemoAction&#58; ********************* after articleDAO load *********************
      Noticed that session is closed. Therefore, LazyInitializationException occurred when attemped to access a lazy collection.

      Based on the above test code, the service load method is fine as it allows lazy access by keep the session open. Does that mean the application needs to wrap all dao methods with a service object? I wouldn't think so as the unit test code below did not cause any exception:

      Code:
      	protected void setUp&#40;&#41; throws Exception &#123;
      	  super.setUp&#40;&#41;;
      	  sessionFactory = &#40;SessionFactory&#41; ctx.getBean&#40;SESSION_FACTORY&#41;;
      	  Session session = SessionFactoryUtils.getSession&#40;sessionFactory, true&#41;;
      	  session.setFlushMode&#40;FlushMode.NEVER&#41;;
      	  TransactionSynchronizationManager.bindResource&#40;sessionFactory, new SessionHolder&#40;session&#41;&#41;;
      	&#125;
      
      
      	public void test&#40;&#41;&#123;
      		Industry department = new Industry&#40;"Demo"&#41;;
      		log.warn&#40;"********************* before contentService insert *******************"&#41;;
      		contentService.insert&#40;department&#41;;
      		log.warn&#40;"********************* before contentService delete *******************"&#41;;
      		contentService.delete&#40;department&#41;;
      		log.warn&#40;"********************* after contentService delete *********************"&#41;;
      
      		log.warn&#40;"********************* before service load *********************"&#41;;
      		Article a = contentService.getArticle&#40;new Long&#40;7321&#41;&#41;;
      		log.warn&#40;"********************* after service load *********************"&#41;;
      		log.warn&#40;"photo size = " + a.getPhotos&#40;&#41;.size&#40;&#41;&#41;;
      		
      		log.warn&#40;"********************* before dao load *********************"&#41;;
      		Article b = articleDAO.getArticle&#40;new Long&#40;7321&#41;&#41;;
      		log.warn&#40;"********************* after dao load *********************"&#41;;
      		log.warn&#40;"photo size = " + b.getPhotos&#40;&#41;.size&#40;&#41;&#41;;
      				
      	&#125;
      	
      	protected void tearDown&#40;&#41; throws Exception &#123;
      	  SessionHolder sessionHolder = &#40;SessionHolder&#41; TransactionSynchronizationManager.unbindResource&#40;sessionFactory&#41;;
      	  Session session = sessionHolder.getSession&#40;&#41;;
      	  session.flush&#40;&#41;;
      	  SessionFactoryUtils.closeSessionIfNecessary&#40;session, sessionFactory&#41;;
      	  super.tearDown&#40;&#41;;
      	&#125;
      your advice is greatly appreciated.

      thanks,

      Comment


      • #4
        After further investigation, i finally found out what the problem was.

        Are you sure that the filter is properly configured and kicks in for your particular request?
        You were right. I changed the filter to now look at /* for all urls since our apps has url mappings. And using
        Code:
        <servlet-name>action</servlet-name>
        is not appropriate here.
        However, I extended the filter to skip all static urls - any missing /images, /stylesheets, /js, and etc would cause it to be triggered.

        Our app has four datasources. OpenSessionInViewFilter only allows a session to be opened thru out the request. I have not try this yet, but does it make sense to have another filter that open another session (different datasource than the main one) for use cases that work with different session factories?

        any suggestions?

        Thanks,

        Comment


        • #5
          hi

          hi

          we also have the problem that our session is closed, an we tried openinviewfilter in web.xml, as interceptor in application-context.xml and other solutions as written by karl baum - but without any success.

          therefore it would be interested which solution worked for you or whether you could give an example of web.xml, java files or application-context.xml - currently we are a bit out of ideas!!!!

          thanx & greetinx

          tuor

          technical infos:

          struts-spring-hibernate
          data of object A is loaded on jsp 1
          item is selected and forward to jsp 2
          on jsp 2 the object A is loaded again but with the required data based on the selection made on jsp 1

          hope this help for a better understanding !!!

          Comment


          • #6
            here it is

            Code:
              <filter>
               <filter-name>hibernateSessionFilter</filter-name>
                <filter-class>org.springframework.orm.hibernate.support.OpenSessionInViewFilter</filter-class>
              </filter> 
            
              <filter-mapping>
                <filter-name>hibernateSessionFilter</filter-name>
              	<url-pattern>/*</url-pattern>
              </filter-mapping>
            Please note that the default behavior use bean name 'sessionFactory'. If you named your session factory otherwise, specified an init param for the factory bean name.

            Like Jurgen said, if if a session is not open, it implies that the url pattern is never triggered and therefore a session is not bind to the threadlocal. So /* should work for you. You can also override shouldNotFilter method to skip certain urls that you know don't need a session.

            Comment


            • #7
              ..

              thanx a lot ...
              i've tried out this approach also - without very much success ...

              but something seems to wired ...

              look at this mapping file - this is the object which is loaded by the wizard againg and again ....


              maybe its the construct of the mapping because its a recursive relation -
              the last mapping is a mapping back to the class itself - could this be a problem?

              i think it might be because when we remove the lazy="true" from this part of the mapping file it works ...

              maybe you give me hint what could be wrong with this file, with me or something else ;-)


              thanx a lot

              greetinx

              tuor


              <?xml version="1.0"?>
              <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
              "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

              <hibernate-mapping>

              <class name="at.univie.auv.redbaron.model.MetaGruppen" table="META_GRUPPEN">
              <meta attribute="class-description">
              @author ZAL
              </meta>

              <id name="tid" column="TID">
              <generator class="at.univie.auv.util.hibernate.TidGenerator">
              <param name="table">META_GRUPPEN</param>
              </generator>
              </id>

              <property name="i3vUserId" column="I3V_USER_ID" type="double" not-null="false"/>

              <property name="i3vDate" column="I3V_DATE" type="string" not-null="false"/>

              <property name="name" column="Name" type="string" not-null="false"/>

              <many-to-one name="application" column="I3V_FILE_ID"
              class="at.univie.auv.redbaron.model.I3VFile"
              insert="true" update="true" cascade="all" />

              <many-to-one name="displayType" column="META_DARSTELLUNG_TYP_ID"
              class="at.univie.auv.redbaron.model.MetaDarstellun gstyp"
              insert="true" update="true" cascade="all"/>

              <set name="metaGruppenSprache" lazy="true" cascade="all">
              <key column="RELATION"/>
              <one-to-many class="at.univie.auv.redbaron.model.MetaGruppenSpr ache" />
              </set>

              <set name="keys" table="META_GRUPPEUNTEROBER_HBEZ" lazy="true" cascade="all">
              <key column="META_GRUPPEN_ID"/>
              <many-to-many column="META_GRUPPEN_ID2"
              class="at.univie.auv.redbaron.model.MetaGruppen"/>
              </set>

              </class>

              <query name="getPagesByApplication">
              <![CDATA[from MetaGruppen as gruppe
              where gruppe.application.tid = :tid
              and gruppe.displayType.code = :typeName ]]>
              </query>

              <query name="getKeysByPage">
              <![CDATA[from MetaGruppen as gruppe
              where gruppe.application.tid = :tid
              and gruppe.displayType.code = :typeName
              and gruppe.tid = ageTid ]]>
              </query>

              </hibernate-mapping>

              Comment


              • #8
                have you check the logs? Set log level to DEBUG and verify if a session is open for that particular URI.

                Try your use case in a test case too. If it works in test case, it should also work with the filter. You should be able to find sample codes from my previous discussion in this topic.

                Comment


                • #9
                  hi

                  thanx for your reply ...

                  in this particular case the log seems to be ok but closes the session for lazy loading this mapping set

                  <class ="at.univie.auv.redbaron.model.MetaGruppen" table="META_GRUPPE">
                  ....
                  <set name="keys" table="META_GRUPPEUNTEROBER_HBEZ" lazy="true" cascade="all">
                  <key column="META_GRUPPEN_ID"/>
                  <many-to-many column="META_GRUPPEN_ID2"
                  class="at.univie.auv.redbaron.model.MetaGruppen"/>
                  </set>

                  ...

                  </class>

                  as is mentioned before - maybe anybody could tell me if this recursive relation is even possible in hibernate or recommended - or is this more an issue for the hibernate forum?

                  thanx again

                  greetinx

                  tuor

                  Comment

                  Working...
                  X