openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alan Roche (JIRA)" <>
Subject [jira] [Commented] (OPENJPA-2364) Slices: Bulk JPQL Deletes/Updates ignoring Target plugins and query hints.
Date Tue, 02 Apr 2013 16:43:15 GMT


Alan Roche commented on OPENJPA-2364:

The workaround for this is to create a dummy table in slice B above to stop the delete query
from failing on slice B. This means the distributed query won't fail, - however it is sub
optimal to say the least, - it is also messy as redundant dummy tables need to be created
> Slices: Bulk JPQL Deletes/Updates ignoring Target plugins and query hints.
> --------------------------------------------------------------------------
>                 Key: OPENJPA-2364
>                 URL:
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: slice
>    Affects Versions: 2.2.1
>            Reporter: Alan Roche
>            Priority: Critical
> I think there is a bug in OpenJPA Slices for Bulk Update Queries (At least for Bulk Delete
> So, if doing a bulk JPQL delete (E.G. "delete from Entity e where in :ids"), - all
slices are hit with the query regardless of Policy plugins and Query hints set to target just
one slice.
> I have implemented DistributionPolicy, FinderTargetPolicy and QueryTargetPolicy as well
as setting the "openjpa.hint.slice.Target" hint on the query and EntityManager.
> All slices are hit regardless of the above when we need to just target 1 Slice. This
causes big problems for us, as some tables do not exist in all slices and queries fail.
> Reproducing this is easy:
> 1/ Set up 2 slices
> 2/ Create table "Person" in slice A but NOT in slice B
> 3/ Register simple  DistributionPolicy, FinderTargetPolicy and QueryTargetPolicy plugins
with OpenJPA Slices, - all hard-coded to only return slice A.
> 4/ Execute JPQL delete "Delete from Person p where = :id" with query hint to slice
> 5/ See that the delete update query is executed against all slices not just slice A as
required by target plugins and query hint 
> 6/ Query fails against slice B because table does not exist in slice B. 
> We have set query hints etc. - but returning slice A in QueryTargetPolicy should be enough

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message