| 
					
						 I have a table in an Oracle database by the name of :
 
 POLICY_ACC_YEAR_SNAPSHOT_FACT 
 
 This table has a M-1 relationship to the POLICY table (one POLICY can have many of these snapshots)
 
 When I query a POLICY and get the Policy class, I now want to get all the PolicySnapshots. When I call collection.iterator, I get this stacktrace :
 
 <Apr 21, 2004 4:18:31 PM GMT-05:00> <Warning> <WLW> <000000> <Id=top-level; Meth
 od=controls.FYLSearchControl.getInitialSummaryReport(); Failure=net.sf.hibernate
 .LazyInitializationException: Failed to lazily initialize a collection [ServiceE
 xception]>
 [/hubzilla] Unhandled exception caught in Global.app:
 net.sf.hibernate.LazyInitializationException: Failed to lazily initialize a coll
 ection
         at net.sf.hibernate.collection.PersistentCollection.initialize(Persisten
 tCollection.java:206)
         at net.sf.hibernate.collection.PersistentCollection.read(PersistentColle
 ction.java:71)
         at net.sf.hibernate.collection.Set.iterator(Set.java:130)
         at com.accidentfund.common.db.dao.FYLInitialDataGenerator.computeInitial
 SummaryReport(FYLInitialDataGenerator.java:97)
         at com.accidentfund.common.db.dao.ReportDAO.getFYLInitialSummaryReport(R
 eportDAO.java:322)
         at controls.FYLSearchControlImpl.getInitialSummaryReport(FYLSearchContro
 lImpl.jcs:20)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
 java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
 sorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.bea.wlw.runtime.core.dispatcher.DispMethod.invoke(DispMethod.java
 :367)
         at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:42
 3)
         at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:39
 6)
         at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:24
 8)
         at com.bea.wlw.runtime.jcs.container.JcsContainer.invoke(JcsContainer.ja
 va:84)
         at com.bea.wlw.runtime.core.bean.BaseContainerBean.invokeBase(BaseContai
 nerBean.java:198)
         at com.bea.wlw.runtime.core.bean.SLSBContainerBean.invoke(SLSBContainerB
 ean.java:103)
         at com.bea.wlwgen.StatelessContainer_ly05hg_ELOImpl.invoke(StatelessCont
 ainer_ly05hg_ELOImpl.java:153)
         at com.bea.wlwgen.GenericStatelessSLSBContAdpt.invokeOnBean(GenericState
 lessSLSBContAdpt.java:62)
         at com.bea.wlw.runtime.core.bean.BaseDispatcherBean.runAsInvoke(BaseDisp
 atcherBean.java:153)
         at com.bea.wlw.runtime.core.bean.BaseDispatcherBean.invoke(BaseDispatche
 rBean.java:54)
         at com.bea.wlw.runtime.core.bean.SyncDispatcherBean.invoke(SyncDispatche
 rBean.java:160)
         at com.bea.wlw.runtime.core.bean.SyncDispatcher_k1mrl8_EOImpl.invoke(Syn
 cDispatcher_k1mrl8_EOImpl.java:100)
         at com.bea.wlw.runtime.core.dispatcher.Dispatcher.remoteDispatch(Dispatc
 her.java:161)
         at com.bea.wlw.runtime.core.dispatcher.ServiceHandleImpl.invoke(ServiceH
 andleImpl.java:414)
         at com.bea.wlw.runtime.core.dispatcher.WlwProxyImpl._invoke(WlwProxyImpl
 .java:275)
         at com.bea.wlw.runtime.core.dispatcher.WlwProxyImpl.invoke(WlwProxyImpl.
 java:264)
         at $Proxy30.getInitialSummaryReport(Unknown Source)
         at pageFlows.lossRuns.LossRunsController.fylSearchAction(LossRunsControl
 ler.jpf:421)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
 java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
 sorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.bea.wlw.netui.pageflow.FlowController.invokeActionMethod(FlowCont
 roller.java:1495)
         at com.bea.wlw.netui.pageflow.FlowController.getActionMethodForward(Flow
 Controller.java:1430)
         at com.bea.wlw.netui.pageflow.FlowController.internalExecute(FlowControl
 ler.java:761)
         at com.bea.wlw.netui.pageflow.PageFlowController.internalExecute(PageFlo
 wController.java:211)
         at com.bea.wlw.netui.pageflow.FlowController.execute(FlowController.java
 :591)
         at org.apache.struts.action.RequestProcessor.processActionPerform(Reques
 tProcessor.java:484)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
 va:274)
         at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor.process(PageFlowR
 equestProcessor.java:651)
         at com.bea.wlw.netui.pageflow.AutoRegisterActionServlet.process(AutoRegi
 sterActionServlet.java:527)
         at com.bea.wlw.netui.pageflow.PageFlowActionServlet.process(PageFlowActi
 onServlet.java:152)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
 
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
 (ServletStubImpl.java:971)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
 pl.java:402)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
 va:27)
         at com.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilte
 r.java:313)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
 va:27)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
 n.run(WebAppServletContext.java:6356)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
 dSubject.java:317)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
 118)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
 rvletContext.java:3635)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
 pl.java:2585)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
 Caused by: net.sf.hibernate.JDBCException: could not initialize collection: [com
 .accidentfund.common.db.hibernate.PolicyDim.policySnapshotFacts#6]
         at net.sf.hibernate.collection.AbstractCollectionPersister.initialize(Ab
 stractCollectionPersister.java:287)
         at net.sf.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.ja
 va:3226)
         at net.sf.hibernate.collection.PersistentCollection.initialize(Persisten
 tCollection.java:200)
         ... 58 more
 Caused by: java.sql.SQLException: ORA-00904: "POLICYSNAP0_"."ACCIDENT_YEAR_CLAIM _COUNT": invalid identifier
 
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
         at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:582)
         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1983)
         at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(TTC7Protocol.java:
 877)
         at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.jav
 a:2513)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStateme
 nt.java:2857)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePrepar
 edStatement.java:608)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePrepare
 dStatement.java:536)
         at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:87)
         at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:795)
         at net.sf.hibernate.loader.Loader.doQuery(Loader.java:189)
         at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections
 (Loader.java:133)
         at net.sf.hibernate.loader.Loader.loadCollection(Loader.java:910)
         at net.sf.hibernate.loader.Loader.loadCollection(Loader.java:885)
         at net.sf.hibernate.loader.OneToManyLoader.initialize(OneToManyLoader.ja
 va:80)
         at net.sf.hibernate.collection.AbstractCollectionPersister.initialize(Ab
 stractCollectionPersister.java:284)
         ... 60 more
 
 
 
 -------------------
 
 As you can see towards the bottom of the trace, it's trying to get the ACCIDENT_YEAR_CLAIM_COUNT column from the snapshot table and is using "POLICYSNAP0_" instead of POLICY_ACC_YEAR_SNAPSHOT_FACT. Why is that ???
 
 Is there an internal limit to the name of a table in hibernate ? If not, how do I bypass this problem ? 
 
 Please help....
 
 
 Suman 
					
  
						
					 |