Monday, May 19, 2008

Let's Go Lazy

It needs a minuite to load Financials.htm, and needs more minuites to load EditFinancial.htm, sometimes permGem error, and the dumb thing is I thought it just perhaps the database server is backuping or doing something which make it slow. And the dumberer thing is I try to use other database server, I create the tables I need one by one, and then I load those data. And the dumbest thing is I feel my application is going faster with the new database although I can write email, download something, or perhaps watching Thomas Cup while waiting my form's load. It's more than Dumb and Dumberer the movies. It was Dumb, Dumberer, and Dumbest.

The Financial table only need CURRENCY_KEY, LOCATION_KEY, etc.. it doesn't need to have the DimCurrency, DimLocation, etc whole as an object to have my Financial object, so I donot need to write extra lazy="false" in my Pojo's XDoclet. It was my bad habit to copy=paste everything without comparing my needs, I copy the Xdoclet declaration from other source that turn not to be lazy one. Hibernate is automatically set to be lazy by default. here's taken from my DimCurrency:

/**
* @return Returns the financials.
*
* @hibernate.bag name="financials" lazy="true" cascade="all"
* @hibernate.collection-key column="CURRENCY_KEY"
* @hibernate.collection-one-to-many class="id.co.model.Financial"
*/
public List getFinancials() {
return financials;
}
public void setFinancials(List financials) {
this.financials = financials;
}

It's still gimme error after I set lazy, the something named GGG error or something. I browse the net and it says that it needs an empty constructor for the pojos, wheter the Financial or the Dims, I forgot it, I just add it into all my pojos. sorry I missed the link, I write this post after repair my application, set it to lazy, and everything's go faster after the lazy things. just let's go to be l[cr]azy for a while!

No comments: