This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Beware of Finders and Getters for CMP in Weblogic  RSS feed

 
Premkumar Rangarajan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
PPL,
Yesterday i discovered one awful thing about Finders and getters for CMP. We are using Weblogic 4.5.1. I ran a finder on a table which returned 10 rows in an enumeration. There were around 10 fields in the table. When i actually used the getters for getting the field values, I found out to my dismay that each get involved in the bean updating the table for that row ( God knows why this should happen. I was doing a simple select on the table only). In oracle i added a trigger to that table to insert into a log table, everytime an update happens to this table. After find and get, I found out that log table had 318 rows inserted, meaning 318 updates had happened to this table. No wonder entity beans are so slow. Anyone, any idea as to why this should happen? Iam seriously thinking now, to scrap all entity beans and to go for session beans with Connection Con. So all you entity bean buffs out there, Think again.
 
Tim Holloway
Bartender
Posts: 18702
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that if you tag the bean as read-only you'll eliminate a lot of that overhead.
As far as the database being UPDATED on a GET, that doesn't sound right. I can understand it being done on a SET for each field, though, since WebLogic is a clusterable server.
BEA's own EJB newsgroups have featured some discussions lately on what does and doesn't cause database traffic. You might want to join in.
 
sandy gupta
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Prem,
I guess u would be knowing about the isModified method, if u supply that method in the DD, the calls to ejbStore can be minimized(Update). This is a very widely discussed problem in the WL Developers circle and the soln is pretty well known as of today.
HTH
Sahil
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!