Help

Controls

PermLinkWikiLink

Built with Seam

You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.

Forum: Seam Users Forum ListTopic List
04. Jun 2008, 20:49 CET | Link

Hi,

our team is having some perfomance issues related lazy loading on class properties.

when we query for an object to entity manager, (searching a client for example) we need to Hibernate.initialize() a class property, that is a class too.

therefore, the last class have more properties that must be initialized!!

so make a simple search is chaining a tree of properties to initialize.

what should you do in a case like this one?

Thanks for reading.

1 Reply:
05. Jun 2008, 00:11 CET | Link

day along, we found a good option.

is not tested yet, but we think that change this code lines:


merchants = em.createQuery("select m from Merchant m where lower(m.merchantGeneralCompanyName) like :merchSearchPattern or lower(m.merchantComertialCompanyName) like :merchSearchPattern")
).setParameter("merchSearchPattern", getSearchPattern())
                  .setMaxResults(pageSize)
                  .setFirstResult( page * pageSize )
                  .getResultList();

for something more specific in the first line can works, something like:


merchants = em.createQuery("select m.generalCompanyName from Merchant m where lower

for example.

what do you think?