You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Thomas Mahler <th...@web.de> on 2003/08/08 08:15:15 UTC

[FAQ] Re: Why select by insert?

Hi,

pb.store(obj) must check if obj is already stored in the db or not to 
choose an UPDATE or an INSERT.
that check done with the select.

You can get rid of this additional select by using hints.
broker.store(obj,ObjectModificationDefaultImpl.INSERT) forces an INSERT.
broker.store(obj,ObjectModificationDefaultImpl.UPDATE) forces an UPDATE.


Thomas

lyl wrote:
> Thanks for oliver, but I just used PB.store()! I used p6spy on front of
> Mysql Driver, there's one select statement preceding each insert
> statement. I wonder what's for? Does this really necessary? 
> Can I disable that ?
> 
> thanx


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org