-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Strange behavior when using .find(id) (Very very slow)
PostPosted: Wed Jan 27, 2010 8:49 pm 
Beginner
Beginner

Joined: Tue Oct 20, 2009 6:28 am
Posts: 20
Hi all!

I built a test that looks as follows:
Code:
@Test
   public void test_SearchAndFind() throws Exception
   {
      LeadDAO leadDAO = (LeadDAO) applicationContext.getBean("leadDAOBean");
      UUID uuid = UUID.fromString("d7ead80f-8b2f-4dd8-8c37-bb29f9382286");      
      
      Search basicSearch = new Search(Lead.class);
      basicSearch.addFilterILike("leadBasicDetails.fullName", "%%"); // How to add filter on object
      basicSearch.addSort("leadBasicDetails.fullName",false);
      
      int count = leadDAO.count(basicSearch);
      log.debug("Count was: " + count);
      leadDAO.search(basicSearch);
      
      [i][b]Lead lead = leadDAO.find(new UuidUserType(uuid));[/b][/i]
      
      // If null we had an error...
      assertNotNull(lead);
      assertTrue(lead.getUuid().getUuid().equals(uuid));
   }
   


The Lead lead = leadDAO.find(new UuidUserType(uuid));

It takes under a second.

But curiously this sequence of code is done in my code and while it returns result each find takes a lot of time... Maybe minutes...

And what I get in log is a lot of lines like:
2010-01-28 01:35:32,965 [http-8080-3] DEBUG org.hibernate.engine.Collections - Collection found: [com.level2.enterprise.hibernate.generated.Lead.leadBasicDetails#com.level2.enterprise.crm.hibernate.datatypes.UuidUserType@7d25da76], was: [com.level2.enterprise.hibernate.generated.Lead.leadBasicDetails#com.level2.enterprise.crm.hibernate.datatypes.UuidUserType@7d25da76] (uninitialized)


One for each result given in the search sentence I think...


What it's curious here is that the class is looking for leadBasicDetails that is linked to lead by a foreign key... Why?


Any help will be appreciated...

Thank you in advance

NOTE: UuidUserType is a custom type to deal with postgresql uuid type. It seemed to work well until now...


Top
 Profile  
 
 Post subject: Re: Strange behavior when using .find(id) (Very very slow)
PostPosted: Thu Jan 28, 2010 6:30 am 
Beginner
Beginner

Joined: Tue Oct 20, 2009 6:28 am
Posts: 20
It's incredible.

My Application only works when in using the JUnit. When it's implemented under tomcat it takes long with this kind of messages.
Code:
.................
11:21:50,488 DEBUG org.hibernate.engine.Collections - Collection found: [com.level2.enterprise.hibernate.generated.Lead.leadBasicDetails#com.level2.enterprise.crm.hibernate.datatypes.UuidUserType@47ef6435], was: [com.level2.enterprise.hibernate.generated.Lead.leadBasicDetails#com.level2.enterprise.crm.hibernate.datatypes.UuidUserType@47ef6435] (uninitialized)
11:21:50,488 DEBUG org.hibernate.engine.Collections - Collection found: [com.level2.enterprise.hibernate.generated.Lead.leadBasicDetails#com.level2.enterprise.crm.hibernate.datatypes.UuidUserType@12d5a9c7], was: [com.level2.enterprise.hibernate.generated.Lead.leadBasicDetails#com.level2.enterprise.crm.hibernate.datatypes.UuidUserType@12d5a9c7] (uninitialized)
11:21:50,489 DEBUG org.hibernate.engine.Collections - Collection found: [com.level2.enterprise.hibernate.generated.Lead.leadBasicDetails#com.level2.enterprise.crm.hibernate.datatypes.UuidUserType@2702574], was: [com.level2.enterprise.hibernate.generated.Lead.leadBasicDetails#com.level2.enterprise.crm.hibernate.datatypes.UuidUserType@2702574] (uninitialized)
11:21:50,489 DEBUG org.hibernate.engine.Collections - Collection found: [com.level2.enterprise.hibernate.generated.Lead.leadBasicDetails#com.level2.enterprise.crm.hibernate.datatypes.UuidUserType@4359a380], was: [com.level2.enterprise.hibernate.generated.Lead.leadBasicDetails#com.level2.enterprise.crm.hibernate.datatypes.UuidUserType@4359a380] (uninitialized)
11:21:50,490 DEBUG org.hibernate.engine.Collections - Collection found: [com.level2.enterprise.hibernate.generated.Lead.leadBasicDetails#com.level2.enterprise.crm.hibernate.datatypes.UuidUserType@6c49d8d0], was: [com.level2.enterprise.hibernate.generated.Lead.leadBasicDetails#com.level2.enterprise.crm.hibernate.datatypes.UuidUserType@6c49d8d0] (uninitialized)
11:21:50,490 DEBUG org.hibernate.engine.Collections - Collection found: [com.level2.enterprise.hibernate.generated.Lead.leadBasicDetails#com.level2.enterprise.crm.hibernate.datatypes.UuidUserType@78c2b43d], was: [com.level2.enterprise.hibernate.generated.Lead.leadBasicDetails#com.level2.enterprise.crm.hibernate.datatypes.UuidUserType@78c2b43d] (uninitialized)
11:21:50,491 DEBUG org.hibernate.engine.Collections - Collection found: [com.level2.enterprise.hibernate.generated.Lead.leadBasicDetails#com.level2.enterprise.crm.hibernate.datatypes.UuidUserType@5701f315], was: [com.level2.enterprise.hibernate.generated.Lead.leadBasicDetails#com.level2.enterprise.crm.hibernate.datatypes.UuidUserType@5701f315] (uninitialized)
11:21:50,491 DEBUG org.hibernate.engine.Collections - Collection found: [com.level2.enterprise.hibernate.generated.Lead.leadBasicDetails#com.level2.enterprise.crm.hibernate.datatypes.UuidUserType@68e8767a], was: [com.level2.enterprise.hibernate.generated.Lead.leadBasicDetails#com.level2.enterprise.crm.hibernate.datatypes.UuidUserType@68e8767a] (uninitialized)
11:21:50,492 DEBUG org.hibernate.engine.Collections - Collection found: [com.level2.enterprise.hibernate.generated.Lead.leadBasicDetails#com.level2.enterprise.crm.hibernate.datatypes.UuidUserType@2577d09e], was: [com.level2.enterprise.hibernate.generated.Lead.leadBasicDetails#com.level2.enterprise.crm.hibernate.datatypes.UuidUserType@2577d09e] (uninitialized)
11:21:50,492 DEBUG org.hibernate.engine.Collections - Collection found: [com.level2.enterprise.hibernate.generated.Lead.leadBasicDetails#com.level2.enterprise.crm.hibernate.datatypes.UuidUserType@3410e063], was: [com.level2.enterprise.hibernate.generated.Lead.leadBasicDetails#com.level2.enterprise.crm.hibernate.datatypes.UuidUserType@3410e063] (uninitialized)
11:21:50,493 DEBUG org.hibernate.engine.Collections - Collection found: [com.level2.enterprise.hibernate.generated.Lead.leadBasicDetails#com.level2.enterprise.crm.hibernate.datatypes.UuidUserType@2054eb70], was: [com.level2.enterprise.hibernate.generated.Lead.leadBasicDetails#com.level2.enterprise.crm.hibernate.datatypes.UuidUserType@2054eb70] (uninitialized)
11


........


Why?

It takes at least 1 minute to take one record with just a find(id)

Can this be a problem with the cache?

I'm getting crazy with this. Never happened before and cannot reproduce isolated.


Top
 Profile  
 
 Post subject: Re: Strange behavior when using .find(id) (Very very slow)
PostPosted: Thu Jan 28, 2010 10:45 am 
Beginner
Beginner

Joined: Tue Oct 20, 2009 6:28 am
Posts: 20
I realized that this only happens when the search returns all the result of the database...

When I filter the result doing a filter it does not happens...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.