Home javax.persistence.EntityManager Losing connection with high volume of data
Reply: 0

javax.persistence.EntityManager Losing connection with high volume of data

AVR Shell
1#
AVR Shell Published in 2017-12-06 16:14:10Z

I have 1 entity RaAuditFindingDetails which has child entities AuditFindingDetailScoreses. RaAuditFindingDetails has around 50000 records, and child entity AuditFindingDetailScoreses has around 500000 records. If i fetch first 3000 RaAuditFindingDetails records it work well, after 3000 records entityManager losses connection to DB. I thought it may be some database error, so i tried fetching 3000 to 6000 records only skipping first 3000 records, and that work well. So my guess is problem is due to high volume of data.

 public List<RaAuditFindingDetailScores> getRatings() throws 
             Exception {
              RaAuditFindingDetails afd=null;
              try {
              afd=  entityManager.find(RaAuditFindingDetails.class,fdId);

        }catch (Exception ext){
            throw  new Exception(ext);
        } 
  return afd.getRaAuditFindingDetailScoreses() ;

}

//Parent Child entity relationship.

@OneToMany(fetch = FetchType.LAZY, mappedBy = "raAuditFindingDetails")
public List<RaAuditFindingDetailScores> getRaAuditFindingDetailScoreses() {
    return this.raAuditFindingDetailScoreses;
}

I have to generate a report which needs all the data. how i can do it. Database if postgress. and getting following error.

IdleRemover notifying pools, interval: 450000 2017-12-06 21:31:43,913 WARN [com.arjuna.ats.arjuna.logging.arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.BasicAction_58] - Abort of action id -3f57fefd:d481:5a28123e:b4 invoked while multiple threads active within it. 2017-12-06 21:31:43,916 WARN [com.arjuna.ats.arjuna.logging.arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.CheckedAction_2] - CheckedAction::check - atomic action -3f57fefd:d481:5a28123e:b4 aborting with 1 threads active! 2017-12-06 21:31:43,959 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.parentTraceEnabled=true 2017-12-06 21:31:43,959 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.nestedTraceEnabled=false 2017-12-06 21:31:43,959 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.detectDuplicateNesting=true 2017-12-06 21:31:43,962 WARN [org.hibernate.util.JDBCExceptionReporter] SQL Error: 0, SQLState: null 2017-12-06 21:31:43,963 ERROR [org.hibernate.util.JDBCExceptionReporter] Transaction is not active: tx=TransactionImple < ac, BasicAction: -3f57fefd:d481:5a28123e:b4 status: ActionStatus.ABORTED >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: -3f57fefd:d481:5a28123e:b4 status: ActionStatus.ABORTED >) 2017-12-06 21:31:43,963 INFO [org.hibernate.event.def.DefaultLoadEventListener] Error performing load command org.hibernate.exception.GenericJDBCException: Cannot open connection at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52) at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449) at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167) at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161) at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1573) at org.hibernate.loader.Loader.doQuery(Loader.java:696) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259) at org.hibernate.loader.Loader.loadEntity(Loader.java:1881) at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:71) at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:65) at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3072) at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:434) at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:415) at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:165) at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:121) at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:905) at org.hibernate.impl.SessionImpl.immediateLoad(SessionImpl.java:863) at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:95) at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:140) at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:190) at com.camsoft.grc.audit.model.audit.rating.RaAuditRtngCriteria_$$_javassist_57.getDisplaySequence(RaAuditRtngCriteria_$$_javassist_57.java) at com.camsoft.grc.audit.model.scoring.RaAuditFindingDetails$1.compare(RaAuditFindingDetails.java:517) at com.camsoft.grc.audit.model.scoring.RaAuditFindingDetails$1.compare(RaAuditFindingDetails.java:513) at java.util.Arrays.mergeSort(Arrays.java:1270) at java.util.Arrays.mergeSort(Arrays.java:1281) at java.util.Arrays.mergeSort(Arrays.java:1281) at java.util.Arrays.sort(Arrays.java:1210) at java.util.Collections.sort(Collections.java:159) at com.camsoft.grc.audit.model.scoring.RaAuditFindingDetails.orderScales(RaAuditFindingDetails.java:513) at com.camsoft.grc.audit.model.scoring.RaAuditFindingDetails.postLoad(RaAuditFindingDetails.java:505) at sun.reflect.GeneratedMethodAccessor580.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.hibernate.ejb.event.BeanCallback.invoke(BeanCallback.java:23) at org.hibernate.ejb.event.EntityCallbackHandler.callback(EntityCallbackHandler.java:80) at org.hibernate.ejb.event.EntityCallbackHandler.postLoad(EntityCallbackHandler.java:73) at org.hibernate.ejb.event.EJB3PostLoadEventListener.onPostLoad(EJB3PostLoadEventListener.java:33) at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:221) at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:877) at org.hibernate.loader.Loader.doQuery(Loader.java:752) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259) at org.hibernate.loader.Loader.loadEntity(Loader.java:1881) at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:71) at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:65) at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3072) at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:434) at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:415) at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:165) at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:223) at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:126) at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:905) at org.hibernate.impl.SessionImpl.get(SessionImpl.java:842) at org.hibernate.impl.SessionImpl.get(SessionImpl.java:835) at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:182) at sun.reflect.GeneratedMethodAccessor310.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.jboss.seam.persistence.EntityManagerInvocationHandler.invoke(EntityManagerInvocationHandler.java:46) at $Proxy188.find(Unknown Source) at com.camsoft.grc.audit.reports.RaReportWizard.getRatings(RaReportWizard.java:730)

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.310392 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO