Hi! Xiaxin, your are right at your point of view.
All the following text are IMHO: In a OOP we always try to get objects before inserting and/or updating. Why? 1) Best end user experience. Users like when the app fill as many data as possible; 2) Selects are always less "harmfull" to database then starting a transaction, trying an insert/update, the rollbacking the transaction. So, I always drive my users to work "query" oriented. Ask the system for data you think is already there. For a small company, having 80000 clients in a table shows that almost all common clients will be there. I'll drive the user to search in several ways for the right one before driving he to put a new client on db. Yes, I understand that are several approachs due to focus of your system. But I think that OJB should not change their behavior... Thanks for ear me. Edson Richter ----- Original Message ----- From: "Thomas Mahler" <[EMAIL PROTECTED]> To: "OJB Users List" <[EMAIL PROTECTED]> Sent: Tuesday, June 10, 2003 3:55 PM Subject: [Fwd: Some Problem about OJB] -------- Original Message -------- Subject: Some Problem about OJB Date: Wed, 11 Jun 2003 0:39:17 +0800 From: xiaxin <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] <[EMAIL PROTECTED]> thma,hi: OJB is a great project I had never seen in the world. but a little problem? :-) When I insert a record which maybe had already been inserted before. in tradional way the database will return a Exception such as "The primary Key constrain violated ". but in ojb, if I use store method, then the record will be updated if already in database, then , should I first query then go to store it ?? this way may be very inefficient. Then how can I get rid off this inefficient? Thanks a lot! xiaxin [EMAIL PROTECTED] 2003-06-11 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.488 / Virus Database: 287 - Release Date: 5/6/2003 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
