Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Performance improvement - delete entity operation

You could have some caching issue, as the objects will still be in the cache,
except for the root object.  However, you would only be able to access them
if querying by primary key, if that is unlikely, then probably not an issue.

You could invalidate the objects yourself using the EclipseLink Session
IdentityMapAccessor invalidation API, or the new JPA 2.0 Cache API in
EclipseLink 1.2/2.0.

Being able to have EclipseLink know about the database cascade would be
useful, you may wish to log a bug/enhancement for this, or search for one
and vote for it.


harshavardhan786 wrote:
> 
> Hi ,
> 
> Currently the entity object's have the cascade delete functionality,
> 
> @Entity
> public class A{
> @onetoone(cascade=cascadetype.remove)
> protected B b;
> }
> 
> This generetes delete for every table in the cascade process
> 
> ===========================================================
> 
> Instead if we move this cascade delete logic from entity to database
> script
> 
> create table B (
> 
> constraint fk_A foreign key
> references A(..)
> ON DELETE CASCADE
> )
> 
> This is much faster.Is this right ?
> Will it create any caching issues ?
> 
> Regards,
> Harsha
> 


-----
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
-- 
View this message in context: http://www.nabble.com/Performance-improvement---delete-entity-operation-tp25746128p25768813.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top