[hibernate-issues] [Hibernate-JIRA] Resolved: (HHH-1567) load fails where get succeeds

Gail Badner (JIRA) noreply at atlassian.com
Mon Jun 16 15:41:33 EDT 2008


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1567?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gail Badner resolved HHH-1567.
------------------------------

      Assignee: Gail Badner
    Resolution: Duplicate

> load fails where get succeeds
> -----------------------------
>
>                 Key: HHH-1567
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1567
>             Project: Hibernate3
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.1.2
>         Environment: hibernate 3.1.2 against sysbase 12.5.2 using jconn3 jdbc driver
>            Reporter: Paul Lorenz
>            Assignee: Gail Badner
>
> I have a POJO which has a column 
> protected Case data;
>   @Type ( type="serializable" )
>   @Basic( fetch=FetchType.EAGER )
>   public Case getData ()
>   {
>     return data;
>   }
>   public void setData (Case data)
>   {
>     this.data = data;
>   }
> I am iterating over every element in the corresponding database table. 
>     Session session = HibernateUtil.currentSession();
>     SQLQuery query = session.createSQLQuery( "select case_id from wf_case" );
>     query.addScalar( "case_id", Hibernate.LONG );
>     List<Long> caseList = query.list();
>     for ( Long caseId : caseList )
>     {
>          WfCase wfCase = (WfCase)session.load( WfCase.class, caseId );
>          if ( wfCase.getData() == null )
>          {
>             System.out.println( "IS  null: " + caseId );
>          }
>          session.evict( wfCase );
>    }
> when I run this, after running through 1500 or 2000 (this number changes between runs), I start getting null returns from wfCase.getData(). After that point, it _always_ returns null. If I call session.evict( wfCase ) on an wfCase which returned null, I get the following exception.
> Exception in thread "main" java.lang.reflect.UndeclaredThrowableException
> 	at $Proxy23.evict(Unknown Source)
> 	at hibernate.test.MilestoneCheck.main(MilestoneCheck.java:64)
> Caused by: java.lang.reflect.InvocationTargetException
> 	at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:301)
> 	... 2 more
> Caused by: java.lang.NoSuchMethodError: com.gblx.improv.fit2flow.engine.WfCase.getHibernateLazyInitializer()Lorg/hibernate/proxy/LazyInitializer;
> 	at com.gblx.improv.fit2flow.engine.WfCase$$EnhancerByCGLIB$$616ee93d.getHibernateLazyInitializer(<generated>)
> 	at org.hibernate.event.def.DefaultEvictEventListener.onEvict(DefaultEvictEventListener.java:47)
> 	at org.hibernate.impl.SessionImpl.fireEvict(SessionImpl.java:965)
> 	at org.hibernate.impl.SessionImpl.evict(SessionImpl.java:957)
> 	... 6 more
> Now, if I change the session.load to session.get, it runs through without any problems. I thought maybe the second level cache provider was to blame, but I switched to using         <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property> in my cfg file, and I still had the same problem.
> Note, I had the same problem when I wasn't using a serializable type, but was rather just mapping it to a byte[].

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list