Stacked Q&A

JVM is taking too long to store the data into arraylist from criteria.list()
  • 0 voting
  • 2022-06-26 00:00

    In my database I am having 11500 records. In DAO layer I am doing like this.

    @Transactional
        public List<TrCaster> searchCasterList()  { 
            return getSessionFactory().getCurrentSession().createCriteria(TrCaster.class).list();
        }
    

    It is working fine and When I am going to store it into another arraylist (say in service layer) It is taking too much time.

    Can anybody suggest me the other approaches to store the data in an ArrayList. (As I am using ZK framework I need to maintain a list.)

    Thanks in advance

  • 1 88 0 0
첨부 파일
답변
총 1개의 답변이있습니다.
  • 답변일: 2022-06-26 00:00

    Is there any List of object in your entity class which is defined as LAZY fetch? In case of LAZY fetch, while you are accessing the entity class, the list will be fetched from database and that might cause the slowness.

  • 0 0 채택된 답변 퍼블 채택!
Tages
    활동순위
    유저
      파트너사