even though we do not  commit after deleting the row from data table it is
not deleting wihtout commit..which is the same in case of 'remove'
then what is the difference between 'delete' and 'remove'
which is more efficient?
plz make me clear...
thanks



Patrick Linskey-2 wrote:
> 
> persist() inserts "in-place" -- i.e., it inserts the record that you
> call persist() on. merge() inserts a copy, so is less efficient.
> 
> remove() will result in a DELETE statement when the transaction commits.
> 
> -Patrick
> 
> On Jan 25, 2008 7:13 PM, Tim Watts <[EMAIL PROTECTED]> wrote:
>> Hi,
>>
>> What's the difference between merge() and persist()?
>>
>> They both add the entity to the persistence context; both will insert the
>> entity if necessary. merge() seems to insert/update as necessary. If so,
>> then
>> why would I ever need persist() since merge() can do everything it can
>> do?
>>
>> Also, is remove() supposed to remove the entity from the database, the
>> persistence context or both?
>>
> 
> 
> 
> -- 
> Patrick Linskey
> 202 669 5907
> 
> 

-- 
View this message in context: 
http://n2.nabble.com/Basic-question%3A-EntityManager.merge%28%29-vs-.persist%28%29--tp209964p530622.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Reply via email to