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