I got a very weired problem. The query (I attached the code with the post) works for a while(after about 2000 records), then I get an java.lang.NoSuchMethodError: com.brightcove.reporting.records.VideoStreamedDetailRecord.getHibernateLazyInitializer()Lorg/hibernate/proxy/LazyInitializer.
The VideoStreamedDetailRecord is my persistent class. I attached the mapping code.
Does anybody have any idea about this? Please help, it is pretty urgent. Thanks
Hibernate version:3.1
Mapping documents: <class name="VideoStreamedDetailRecord" table="video_stream_detail_record"> <!--cache usage="dont use cache, would be inefficient use since we bulk read"/--> <id name="id" type="long" column="id" unsaved-value="0"> @@hibernateIDGenerator@@ </id> <property name="dateRecorded" column="date_recorded" type="timestamp" not-null="true"/> <property name="publisherId" column="publisher_id" type="long" not-null="false"/> <property name="affiliateId" column="affiliate_id" type="long" not-null="false"/> <property name="videoId" column="video_id" type="long" not-null="true"/> <property name="videoTitle" column="video_title" type="string" not-null="false" length="128"/> <property name="lineUpId" column="lineup_id" type="long" not-null="false"/> <property name="lineUpTitle" column="lineup_title" type="string" not-null="false" length="128"/> <property name="playerId" column="player_id" type="long" not-null="true"/> <property name="playerName" column="player_name" type="string" not-null="false" length="128"/> <property name="playerTag" column="player_tag" type="string" not-null="false"/> <property name="progressiveDownload" column="is_progressive" type="boolean" not-null="true"/> <property name="secondsStreamed" column="seconds_streamed" type="int" not-null="true"/> <property name="state" column="state" type="byte"/> <property name="economicModel"> <type name="com.brightcove.utils.EnumUserType"> <param name="enumClassName">com.brightcove.payments.EconomicModelType</param> </type> </property> </class>
Code between sessionFactory.openSession() and session.close(): public <T extends StatefulRecord> Iterator<T> dataToProcessByConsumerAccount( Class<T> pClazz, Long pConsumerId, int pBatchSize){ Session sess = ThreadLocalSession.getCurrentSession() ;
// We do not put the class name directly in the query string because it is // eaiser for eclipse to do refactoring. String DATAITEM_TOBEPROCESSED_BY_PUBID = "FROM " + pClazz.getName() + " AS r " + " WHERE r.state = :dataSate " + " AND r.consumerId = :pubId " + " ORDER BY r.dateRecorded ASC"; Query q = sess.createQuery(DATAITEM_TOBEPROCESSED_BY_PUBID) ; q.setParameter("dataSate", RecordStateEnum.OPEN) ; q.setParameter("pubId", pConsumerId) ; if( pBatchSize > 0 ){ q.setMaxResults( pBatchSize ) ; }
Full stack trace of any exception that occurs:
java.lang.NoSuchMethodError: com.brightcove.reporting.records.VideoStreamedDetailRecord.getHibernateLazyInitializer()Lorg/hibernate/proxy/LazyInitializer; at com.brightcove.reporting.records.VideoStreamedDetailRecord$$EnhancerByCGLIB$$d869ed93.getHibernateLazyInitializer(<generated>) at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:274) at org.hibernate.type.EntityType.resolve(EntityType.java:303) at org.hibernate.type.EntityType.nullSafeGet(EntityType.java:217) at org.hibernate.impl.IteratorImpl.postNext(IteratorImpl.java:93) at org.hibernate.impl.IteratorImpl.next(IteratorImpl.java:120) at com.brightcove.payments.PaymentSchedulerFacade.processRecordForCorporateAccount(PaymentSchedulerFacade.java:404) at com.brightcove.payments.PaymentSchedulerFacade.processVideoStreamedDetailRecords(PaymentSchedulerFacade.java:144) at com.brightcove.payments.ProcessUsageDataJob.executeJob(ProcessUsageDataJob.java:24) at com.brightcove.scheduler.SchedulerJob.execute(SchedulerJob.java:22) at org.quartz.core.JobRunShell.run(JobRunShell.java:191) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:516)
Name and version of the database you are using: Oracle
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
|