-->
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.  [ 2 posts ] 
Author Message
 Post subject: performance problem - inserting new objects to database
PostPosted: Fri Mar 12, 2004 8:32 am 
Regular
Regular

Joined: Fri Nov 21, 2003 10:23 am
Posts: 81
I have big performance problem while inserting (updating) objects to database.
For brief I have objects: InstrumentHistory and History

I am going to insert big number of InstrumentHistory objects, using f.e.SessionBean.
1. Problem is, that InstrumentHistory object contains Instrument object that have high number of fields.

Code:
  /**
   * @hibernate.many-to-one  column="instrumentId" class="com.finance.domainmodel.Instrument"
   */
    public InstrumentStatic getInstrument() {
      return instrument;
    }


and
2. SessionBean receives from client object similar to InstrumentHistory, InstrumentHistoryDirect. This InstrumentHistoryDirect not contain Instrument object inside, but instead of that includes only instrumentId.

In result of 2. SessionBean in method implementing insert must search for object Instrument with instrumentId equals instrumentId that comes from InstrumentHistoryDirect. And than must construct InstrumentHistory object from InstrumentHistoryDirect instead of direct insert to InstrumentHistory table with instrumentId. And its bottleneck.

I will be happy for any help.

Note: reason for having InstrumentHistoryDirect object is f.e. import file where are stored only instrumentId values, or using other non-java clients, that are sending to backend only instrumentId, not whole Instrument object.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 12, 2004 9:56 am 
Beginner
Beginner

Joined: Wed Feb 04, 2004 5:21 pm
Posts: 37
I would suggest building a junit test which does the work similar to that of the session bean. Then post the code carried out in the test. Giving advice based on a code example is much easier.

Are you familiar with lazy loading and proxies ?

Have you used the hibernate.show_sql=true to check what sql is generated ?

Henrik


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.