You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Pinaki Poddar (JIRA)" <ji...@apache.org> on 2006/08/29 01:36:22 UTC

[jira] Created: (OPENJPA-35) In-memory Delete operation fails with active DataCache

In-memory Delete operation fails with active DataCache
------------------------------------------------------

                 Key: OPENJPA-35
                 URL: http://issues.apache.org/jira/browse/OPENJPA-35
             Project: OpenJPA
          Issue Type: Bug
          Components: datacache, query
         Environment: Only happens when DataCache is active
			<property name="openjpa.DataCache"                value="true"/>
			<property name="openjpa.RemoteCommitProvider"     value="sjvm"/>

            Reporter: Pinaki Poddar


Delete through query such as 
		Query query = em.createQuery("DELETE FROM Node n");
		query.executeUpdate();

fails with following exception (only when DataCache is active)
Exception in thread "main" <4|false|0.0.0> org.apache.openjpa.persistence.ArgumentException: org.apache.openjpa.datacache.QueryCacheStoreQuery
	at org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.java:1029)
	at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeDelete(ExpressionStoreQuery.java:665)
	at org.apache.openjpa.datacache.QueryCacheStoreQuery$QueryCacheExecutor.executeDelete(QueryCacheStoreQuery.java:348)
	at org.apache.openjpa.kernel.QueryImpl.delete(QueryImpl.java:1012)
	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:768)
	at org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:831)
	at org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:827)
	at org.apache.openjpa.kernel.DelegatingQuery.deleteAll(DelegatingQuery.java:544)
	at org.apache.openjpa.persistence.QueryImpl.executeUpdate(QueryImpl.java:299)
	at control.Test.clear(Test.java:87)
	at control.Test.run(Test.java:37)
	at control.Test.main(Test.java:178)
Caused by: java.lang.ClassCastException: org.apache.openjpa.datacache.QueryCacheStoreQuery
	at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeQuery(ExpressionStoreQuery.java:651)
	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:949)
	at org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.java:1018)
	... 11 more


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

RE: [jira] Commented: (OPENJPA-35) In-memory Delete operation fails with active DataCache

Posted by Pinaki Poddar <pp...@bea.com>.
Patrick,
   I added the trace output of the test for "delete via query does not
remove the copy from the L2 cache".
   The deleted instance was locked/modified after the transaction that
deleted it was committed.
   Does that signal the L2 cache to heal itself?

 


Pinaki Poddar
BEA Systems
415.402.7317  


-----Original Message-----
From: Patrick Linskey [mailto:plinskey@bea.com] 
Sent: Wednesday, February 28, 2007 3:24 PM
To: open-jpa-dev@incubator.apache.org
Subject: RE: [jira] Commented: (OPENJPA-35) In-memory Delete operation
fails with active DataCache

I'm wondering whether or not the cache is properly healing itself, which
gives us a feel for how severe the problem is.

> em.begin();
> em.remove(pc);
> em.commit();
> 
> pc.setSomething();
> em.lock(pc, READ);

I am interested in the behavior when using delete-by-query, as I'm
pretty sure that I know what will happen in that situation.

My expectation is that the cache will clean itself up after the initial
locked read or write, which isn't nearly as bad as the cache never
cleaning itself up, but clearly worse than the cache cleaning itself up
in the first place.

-Patrick

--
Patrick Linskey
BEA Systems, Inc. 

_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it. 

> -----Original Message-----
> From: Pinaki Poddar [mailto:ppoddar@bea.com]
> Sent: Wednesday, February 28, 2007 2:58 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: [jira] Commented: (OPENJPA-35) In-memory Delete operation

> fails with active DataCache
> 
> do you mean to lock or modify the object *after* delete? 
> something like:
> em.begin();
> em.remove(pc);
> em.commit();
> 
> pc.setSomething();
> em.lock(pc, READ);
> .... 
> 
> 
> Pinaki Poddar
> BEA Systems
> 415.402.7317
> 
> 
> -----Original Message-----
> From: Patrick Linskey
> Sent: Wednesday, February 28, 2007 2:47 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: [jira] Commented: (OPENJPA-35) In-memory Delete operation

> fails with active DataCache
> 
> I was referring to subsequent transactions after the delete. 
> The delete
> happens in its own persistence context, meaning that anything that has

> happened in the transaction to date is basically ignored.
> 
> -Patrick
> 
> --
> Patrick Linskey
> BEA Systems, Inc. 
> 
> ______________________________________________________________
> _________
> Notice:  This email message, together with any attachments, may 
> contain information  of  BEA Systems,  Inc.,  its subsidiaries  and 
> affiliated entities,  that may be confidential,  proprietary, 
> copyrighted  and/or legally privileged, and is intended solely for the

> use of the individual or entity named in this message. If you are not 
> the intended recipient, and have received this message in error, 
> please immediately return this by email and then delete it.
> 
> > -----Original Message-----
> > From: Pinaki Poddar [mailto:ppoddar@bea.com]
> > Sent: Wednesday, February 28, 2007 2:14 PM
> > To: open-jpa-dev@incubator.apache.org
> > Subject: RE: [jira] Commented: (OPENJPA-35) In-memory
> Delete operation
> 
> > fails with active DataCache
> > 
> >    The issue is now better be stated as "Delete by Query does not 
> > remove the copy from L2 cache".
> > 
> >    a) Tried to lock the instance, before delete causes
> commit to fail
> > with OptimisticVerification
> >    b) Modifying the object before delete causes no change
> in behaviour
> > in the scope of the given test.   
> > 
> > 
> > Pinaki Poddar
> > BEA Systems
> > 415.402.7317
> > 
> > 
> > -----Original Message-----
> > From: Patrick Linskey (JIRA) [mailto:jira@apache.org]
> > Sent: Wednesday, February 28, 2007 2:00 PM
> > To: open-jpa-dev@incubator.apache.org
> > Subject: [jira] Commented: (OPENJPA-35) In-memory Delete operation 
> > fails with active DataCache
> > 
> > 
> >     [
> > https://issues.apache.org/jira/browse/OPENJPA-35?page=com.atla
> ssian.jira
> > .plugin.system.issuetabpanels:comment-tabpanel#action_12476732 ]
> > 
> > Patrick Linskey commented on OPENJPA-35:
> > ----------------------------------------
> > 
> > What happens if the user modifies the object or if the user
> obtains a
> > read lock on the instance?
> > 
> > > In-memory Delete operation fails with active DataCache
> > > ------------------------------------------------------
> > >
> > >                 Key: OPENJPA-35
> > >                 URL: 
> > https://issues.apache.org/jira/browse/OPENJPA-35
> > >             Project: OpenJPA
> > >          Issue Type: Bug
> > >          Components: datacache, query
> > >         Environment: Only happens when DataCache is active
> > > 			<property name="openjpa.DataCache"
> > value="true"/>
> > > 			<property name="openjpa.RemoteCommitProvider"
> > value="sjvm"/>
> > >            Reporter: Pinaki Poddar
> > >            Priority: Critical
> > >         Attachments: openjpa-35.test.zip
> > >
> > >
> > > Delete through query such as 
> > > 		Query query = em.createQuery("DELETE FROM Node n");
> > > 		query.executeUpdate();
> > > fails with following exception (only when DataCache is active) 
> > > Exception in thread "main" <4|false|0.0.0>
> > org.apache.openjpa.persistence.ArgumentException:
> > org.apache.openjpa.datacache.QueryCacheStoreQuery
> > > 	at
> > org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.j
> > ava:1029)
> > > 	at
> > org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecut
> or.execute
> > Delete(ExpressionStoreQuery.java:665)
> > > 	at
> > org.apache.openjpa.datacache.QueryCacheStoreQuery$QueryCacheEx
> ecutor.exe
> > cuteDelete(QueryCacheStoreQuery.java:348)
> > > 	at
> > org.apache.openjpa.kernel.QueryImpl.delete(QueryImpl.java:1012)
> > > 	at
> > org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:768)
> > > 	at
> > org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:831)
> > > 	at
> > org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:827)
> > > 	at
> > org.apache.openjpa.kernel.DelegatingQuery.deleteAll(Delegating
> > Query.java
> > :544)
> > > 	at
> > org.apache.openjpa.persistence.QueryImpl.executeUpdate(QueryIm
> > pl.java:29
> > 9)
> > > 	at control.Test.clear(Test.java:87)
> > > 	at control.Test.run(Test.java:37)
> > > 	at control.Test.main(Test.java:178) Caused by: 
> > > java.lang.ClassCastException:
> > org.apache.openjpa.datacache.QueryCacheStoreQuery
> > > 	at
> > org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecut
> or.execute
> > Query(ExpressionStoreQuery.java:651)
> > > 	at
> > org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:949)
> > > 	at
> > org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.j
> > ava:1018)
> > > 	... 11 more
> > 
> > --
> > This message is automatically generated by JIRA.
> > -
> > You can reply to this email to add a comment to the issue online.
> > 
> > ______________________________________________________________
> > _________
> > Notice:  This email message, together with any attachments, may 
> > contain information  of  BEA Systems,  Inc.,  its subsidiaries  and 
> > affiliated entities,  that may be confidential,  proprietary, 
> > copyrighted  and/or legally privileged, and is intended solely for 
> > the use of the individual or entity named in this message. If you 
> > are not the intended recipient, and have received this message in 
> > error, please immediately return this by email and then delete it.
> > 
> 

RE: [jira] Commented: (OPENJPA-35) In-memory Delete operation fails with active DataCache

Posted by Patrick Linskey <pl...@bea.com>.
I'm wondering whether or not the cache is properly healing itself, which
gives us a feel for how severe the problem is.

> em.begin();
> em.remove(pc);
> em.commit();
> 
> pc.setSomething();
> em.lock(pc, READ);

I am interested in the behavior when using delete-by-query, as I'm
pretty sure that I know what will happen in that situation.

My expectation is that the cache will clean itself up after the initial
locked read or write, which isn't nearly as bad as the cache never
cleaning itself up, but clearly worse than the cache cleaning itself up
in the first place.

-Patrick

-- 
Patrick Linskey
BEA Systems, Inc. 

_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it. 

> -----Original Message-----
> From: Pinaki Poddar [mailto:ppoddar@bea.com] 
> Sent: Wednesday, February 28, 2007 2:58 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: [jira] Commented: (OPENJPA-35) In-memory Delete 
> operation fails with active DataCache
> 
> do you mean to lock or modify the object *after* delete? 
> something like:
> em.begin();
> em.remove(pc);
> em.commit();
> 
> pc.setSomething();
> em.lock(pc, READ);
> .... 
> 
> 
> Pinaki Poddar
> BEA Systems
> 415.402.7317  
> 
> 
> -----Original Message-----
> From: Patrick Linskey 
> Sent: Wednesday, February 28, 2007 2:47 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: [jira] Commented: (OPENJPA-35) In-memory Delete operation
> fails with active DataCache
> 
> I was referring to subsequent transactions after the delete. 
> The delete
> happens in its own persistence context, meaning that anything that has
> happened in the transaction to date is basically ignored.
> 
> -Patrick
> 
> --
> Patrick Linskey
> BEA Systems, Inc. 
> 
> ______________________________________________________________
> _________
> Notice:  This email message, together with any attachments, 
> may contain
> information  of  BEA Systems,  Inc.,  its subsidiaries  and  
> affiliated
> entities,  that may be confidential,  proprietary,  
> copyrighted  and/or
> legally privileged, and is intended solely for the use of the 
> individual
> or entity named in this message. If you are not the intended 
> recipient,
> and have received this message in error, please immediately 
> return this
> by email and then delete it. 
> 
> > -----Original Message-----
> > From: Pinaki Poddar [mailto:ppoddar@bea.com]
> > Sent: Wednesday, February 28, 2007 2:14 PM
> > To: open-jpa-dev@incubator.apache.org
> > Subject: RE: [jira] Commented: (OPENJPA-35) In-memory 
> Delete operation
> 
> > fails with active DataCache
> > 
> >    The issue is now better be stated as "Delete by Query does not 
> > remove the copy from L2 cache".
> > 
> >    a) Tried to lock the instance, before delete causes 
> commit to fail 
> > with OptimisticVerification
> >    b) Modifying the object before delete causes no change 
> in behaviour
> > in the scope of the given test.   
> > 
> > 
> > Pinaki Poddar
> > BEA Systems
> > 415.402.7317
> > 
> > 
> > -----Original Message-----
> > From: Patrick Linskey (JIRA) [mailto:jira@apache.org]
> > Sent: Wednesday, February 28, 2007 2:00 PM
> > To: open-jpa-dev@incubator.apache.org
> > Subject: [jira] Commented: (OPENJPA-35) In-memory Delete operation 
> > fails with active DataCache
> > 
> > 
> >     [
> > https://issues.apache.org/jira/browse/OPENJPA-35?page=com.atla
> ssian.jira
> > .plugin.system.issuetabpanels:comment-tabpanel#action_12476732 ] 
> > 
> > Patrick Linskey commented on OPENJPA-35:
> > ----------------------------------------
> > 
> > What happens if the user modifies the object or if the user 
> obtains a
> > read lock on the instance?
> > 
> > > In-memory Delete operation fails with active DataCache
> > > ------------------------------------------------------
> > >
> > >                 Key: OPENJPA-35
> > >                 URL: 
> > https://issues.apache.org/jira/browse/OPENJPA-35
> > >             Project: OpenJPA
> > >          Issue Type: Bug
> > >          Components: datacache, query
> > >         Environment: Only happens when DataCache is active
> > > 			<property name="openjpa.DataCache"
> > value="true"/>
> > > 			<property name="openjpa.RemoteCommitProvider"
> > value="sjvm"/>
> > >            Reporter: Pinaki Poddar
> > >            Priority: Critical
> > >         Attachments: openjpa-35.test.zip
> > >
> > >
> > > Delete through query such as 
> > > 		Query query = em.createQuery("DELETE FROM Node n");
> > > 		query.executeUpdate();
> > > fails with following exception (only when DataCache is active) 
> > > Exception in thread "main" <4|false|0.0.0>
> > org.apache.openjpa.persistence.ArgumentException:
> > org.apache.openjpa.datacache.QueryCacheStoreQuery
> > > 	at
> > org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.j
> > ava:1029)
> > > 	at
> > org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecut
> or.execute
> > Delete(ExpressionStoreQuery.java:665)
> > > 	at
> > org.apache.openjpa.datacache.QueryCacheStoreQuery$QueryCacheEx
> ecutor.exe
> > cuteDelete(QueryCacheStoreQuery.java:348)
> > > 	at
> > org.apache.openjpa.kernel.QueryImpl.delete(QueryImpl.java:1012)
> > > 	at
> > org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:768)
> > > 	at
> > org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:831)
> > > 	at
> > org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:827)
> > > 	at
> > org.apache.openjpa.kernel.DelegatingQuery.deleteAll(Delegating
> > Query.java
> > :544)
> > > 	at
> > org.apache.openjpa.persistence.QueryImpl.executeUpdate(QueryIm
> > pl.java:29
> > 9)
> > > 	at control.Test.clear(Test.java:87)
> > > 	at control.Test.run(Test.java:37)
> > > 	at control.Test.main(Test.java:178)
> > > Caused by: java.lang.ClassCastException:
> > org.apache.openjpa.datacache.QueryCacheStoreQuery
> > > 	at
> > org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecut
> or.execute
> > Query(ExpressionStoreQuery.java:651)
> > > 	at
> > org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:949)
> > > 	at
> > org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.j
> > ava:1018)
> > > 	... 11 more
> > 
> > --
> > This message is automatically generated by JIRA.
> > -
> > You can reply to this email to add a comment to the issue online.
> > 
> > ______________________________________________________________
> > _________
> > Notice:  This email message, together with any attachments, 
> > may contain
> > information  of  BEA Systems,  Inc.,  its subsidiaries  and  
> > affiliated
> > entities,  that may be confidential,  proprietary,  
> > copyrighted  and/or
> > legally privileged, and is intended solely for the use of the 
> > individual
> > or entity named in this message. If you are not the intended 
> > recipient,
> > and have received this message in error, please immediately 
> > return this
> > by email and then delete it.
> > 
> 

RE: [jira] Commented: (OPENJPA-35) In-memory Delete operation fails with active DataCache

Posted by Pinaki Poddar <pp...@bea.com>.
do you mean to lock or modify the object *after* delete? 
something like:
em.begin();
em.remove(pc);
em.commit();

pc.setSomething();
em.lock(pc, READ);
.... 


Pinaki Poddar
BEA Systems
415.402.7317  


-----Original Message-----
From: Patrick Linskey 
Sent: Wednesday, February 28, 2007 2:47 PM
To: open-jpa-dev@incubator.apache.org
Subject: RE: [jira] Commented: (OPENJPA-35) In-memory Delete operation
fails with active DataCache

I was referring to subsequent transactions after the delete. The delete
happens in its own persistence context, meaning that anything that has
happened in the transaction to date is basically ignored.

-Patrick

--
Patrick Linskey
BEA Systems, Inc. 

_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it. 

> -----Original Message-----
> From: Pinaki Poddar [mailto:ppoddar@bea.com]
> Sent: Wednesday, February 28, 2007 2:14 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: [jira] Commented: (OPENJPA-35) In-memory Delete operation

> fails with active DataCache
> 
>    The issue is now better be stated as "Delete by Query does not 
> remove the copy from L2 cache".
> 
>    a) Tried to lock the instance, before delete causes commit to fail 
> with OptimisticVerification
>    b) Modifying the object before delete causes no change in behaviour
> in the scope of the given test.   
> 
> 
> Pinaki Poddar
> BEA Systems
> 415.402.7317
> 
> 
> -----Original Message-----
> From: Patrick Linskey (JIRA) [mailto:jira@apache.org]
> Sent: Wednesday, February 28, 2007 2:00 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: [jira] Commented: (OPENJPA-35) In-memory Delete operation 
> fails with active DataCache
> 
> 
>     [
> https://issues.apache.org/jira/browse/OPENJPA-35?page=com.atla
ssian.jira
> .plugin.system.issuetabpanels:comment-tabpanel#action_12476732 ] 
> 
> Patrick Linskey commented on OPENJPA-35:
> ----------------------------------------
> 
> What happens if the user modifies the object or if the user obtains a
> read lock on the instance?
> 
> > In-memory Delete operation fails with active DataCache
> > ------------------------------------------------------
> >
> >                 Key: OPENJPA-35
> >                 URL: 
> https://issues.apache.org/jira/browse/OPENJPA-35
> >             Project: OpenJPA
> >          Issue Type: Bug
> >          Components: datacache, query
> >         Environment: Only happens when DataCache is active
> > 			<property name="openjpa.DataCache"
> value="true"/>
> > 			<property name="openjpa.RemoteCommitProvider"
> value="sjvm"/>
> >            Reporter: Pinaki Poddar
> >            Priority: Critical
> >         Attachments: openjpa-35.test.zip
> >
> >
> > Delete through query such as 
> > 		Query query = em.createQuery("DELETE FROM Node n");
> > 		query.executeUpdate();
> > fails with following exception (only when DataCache is active) 
> > Exception in thread "main" <4|false|0.0.0>
> org.apache.openjpa.persistence.ArgumentException:
> org.apache.openjpa.datacache.QueryCacheStoreQuery
> > 	at
> org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.j
> ava:1029)
> > 	at
> org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecut
or.execute
> Delete(ExpressionStoreQuery.java:665)
> > 	at
> org.apache.openjpa.datacache.QueryCacheStoreQuery$QueryCacheEx
ecutor.exe
> cuteDelete(QueryCacheStoreQuery.java:348)
> > 	at
> org.apache.openjpa.kernel.QueryImpl.delete(QueryImpl.java:1012)
> > 	at
> org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:768)
> > 	at
> org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:831)
> > 	at
> org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:827)
> > 	at
> org.apache.openjpa.kernel.DelegatingQuery.deleteAll(Delegating
> Query.java
> :544)
> > 	at
> org.apache.openjpa.persistence.QueryImpl.executeUpdate(QueryIm
> pl.java:29
> 9)
> > 	at control.Test.clear(Test.java:87)
> > 	at control.Test.run(Test.java:37)
> > 	at control.Test.main(Test.java:178)
> > Caused by: java.lang.ClassCastException:
> org.apache.openjpa.datacache.QueryCacheStoreQuery
> > 	at
> org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecut
or.execute
> Query(ExpressionStoreQuery.java:651)
> > 	at
> org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:949)
> > 	at
> org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.j
> ava:1018)
> > 	... 11 more
> 
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
> 
> ______________________________________________________________
> _________
> Notice:  This email message, together with any attachments, 
> may contain
> information  of  BEA Systems,  Inc.,  its subsidiaries  and  
> affiliated
> entities,  that may be confidential,  proprietary,  
> copyrighted  and/or
> legally privileged, and is intended solely for the use of the 
> individual
> or entity named in this message. If you are not the intended 
> recipient,
> and have received this message in error, please immediately 
> return this
> by email and then delete it.
> 

RE: [jira] Commented: (OPENJPA-35) In-memory Delete operation fails with active DataCache

Posted by Patrick Linskey <pl...@bea.com>.
I was referring to subsequent transactions after the delete. The delete
happens in its own persistence context, meaning that anything that has
happened in the transaction to date is basically ignored.

-Patrick

-- 
Patrick Linskey
BEA Systems, Inc. 

_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it. 

> -----Original Message-----
> From: Pinaki Poddar [mailto:ppoddar@bea.com] 
> Sent: Wednesday, February 28, 2007 2:14 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: RE: [jira] Commented: (OPENJPA-35) In-memory Delete 
> operation fails with active DataCache
> 
>    The issue is now better be stated as "Delete by Query does 
> not remove
> the copy from L2 cache".
> 
>    a) Tried to lock the instance, before delete causes commit to fail
> with OptimisticVerification
>    b) Modifying the object before delete causes no change in behaviour
> in the scope of the given test.   
> 
> 
> Pinaki Poddar
> BEA Systems
> 415.402.7317  
> 
> 
> -----Original Message-----
> From: Patrick Linskey (JIRA) [mailto:jira@apache.org] 
> Sent: Wednesday, February 28, 2007 2:00 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: [jira] Commented: (OPENJPA-35) In-memory Delete 
> operation fails
> with active DataCache
> 
> 
>     [
> https://issues.apache.org/jira/browse/OPENJPA-35?page=com.atla
ssian.jira
> .plugin.system.issuetabpanels:comment-tabpanel#action_12476732 ] 
> 
> Patrick Linskey commented on OPENJPA-35:
> ----------------------------------------
> 
> What happens if the user modifies the object or if the user obtains a
> read lock on the instance?
> 
> > In-memory Delete operation fails with active DataCache
> > ------------------------------------------------------
> >
> >                 Key: OPENJPA-35
> >                 URL: 
> https://issues.apache.org/jira/browse/OPENJPA-35
> >             Project: OpenJPA
> >          Issue Type: Bug
> >          Components: datacache, query
> >         Environment: Only happens when DataCache is active
> > 			<property name="openjpa.DataCache"
> value="true"/>
> > 			<property name="openjpa.RemoteCommitProvider"
> value="sjvm"/>
> >            Reporter: Pinaki Poddar
> >            Priority: Critical
> >         Attachments: openjpa-35.test.zip
> >
> >
> > Delete through query such as 
> > 		Query query = em.createQuery("DELETE FROM Node n");
> > 		query.executeUpdate();
> > fails with following exception (only when DataCache is active) 
> > Exception in thread "main" <4|false|0.0.0>
> org.apache.openjpa.persistence.ArgumentException:
> org.apache.openjpa.datacache.QueryCacheStoreQuery
> > 	at
> org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.j
> ava:1029)
> > 	at
> org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecut
or.execute
> Delete(ExpressionStoreQuery.java:665)
> > 	at
> org.apache.openjpa.datacache.QueryCacheStoreQuery$QueryCacheEx
ecutor.exe
> cuteDelete(QueryCacheStoreQuery.java:348)
> > 	at
> org.apache.openjpa.kernel.QueryImpl.delete(QueryImpl.java:1012)
> > 	at
> org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:768)
> > 	at
> org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:831)
> > 	at
> org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:827)
> > 	at
> org.apache.openjpa.kernel.DelegatingQuery.deleteAll(Delegating
> Query.java
> :544)
> > 	at
> org.apache.openjpa.persistence.QueryImpl.executeUpdate(QueryIm
> pl.java:29
> 9)
> > 	at control.Test.clear(Test.java:87)
> > 	at control.Test.run(Test.java:37)
> > 	at control.Test.main(Test.java:178)
> > Caused by: java.lang.ClassCastException:
> org.apache.openjpa.datacache.QueryCacheStoreQuery
> > 	at
> org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecut
or.execute
> Query(ExpressionStoreQuery.java:651)
> > 	at
> org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:949)
> > 	at
> org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.j
> ava:1018)
> > 	... 11 more
> 
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
> 
> ______________________________________________________________
> _________
> Notice:  This email message, together with any attachments, 
> may contain
> information  of  BEA Systems,  Inc.,  its subsidiaries  and  
> affiliated
> entities,  that may be confidential,  proprietary,  
> copyrighted  and/or
> legally privileged, and is intended solely for the use of the 
> individual
> or entity named in this message. If you are not the intended 
> recipient,
> and have received this message in error, please immediately 
> return this
> by email and then delete it.
> 

RE: [jira] Commented: (OPENJPA-35) In-memory Delete operation fails with active DataCache

Posted by Pinaki Poddar <pp...@bea.com>.
   The issue is now better be stated as "Delete by Query does not remove
the copy from L2 cache".

   a) Tried to lock the instance, before delete causes commit to fail
with OptimisticVerification
   b) Modifying the object before delete causes no change in behaviour
in the scope of the given test.   


Pinaki Poddar
BEA Systems
415.402.7317  


-----Original Message-----
From: Patrick Linskey (JIRA) [mailto:jira@apache.org] 
Sent: Wednesday, February 28, 2007 2:00 PM
To: open-jpa-dev@incubator.apache.org
Subject: [jira] Commented: (OPENJPA-35) In-memory Delete operation fails
with active DataCache


    [
https://issues.apache.org/jira/browse/OPENJPA-35?page=com.atlassian.jira
.plugin.system.issuetabpanels:comment-tabpanel#action_12476732 ] 

Patrick Linskey commented on OPENJPA-35:
----------------------------------------

What happens if the user modifies the object or if the user obtains a
read lock on the instance?

> In-memory Delete operation fails with active DataCache
> ------------------------------------------------------
>
>                 Key: OPENJPA-35
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-35
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: datacache, query
>         Environment: Only happens when DataCache is active
> 			<property name="openjpa.DataCache"
value="true"/>
> 			<property name="openjpa.RemoteCommitProvider"
value="sjvm"/>
>            Reporter: Pinaki Poddar
>            Priority: Critical
>         Attachments: openjpa-35.test.zip
>
>
> Delete through query such as 
> 		Query query = em.createQuery("DELETE FROM Node n");
> 		query.executeUpdate();
> fails with following exception (only when DataCache is active) 
> Exception in thread "main" <4|false|0.0.0>
org.apache.openjpa.persistence.ArgumentException:
org.apache.openjpa.datacache.QueryCacheStoreQuery
> 	at
org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.java:1029)
> 	at
org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.execute
Delete(ExpressionStoreQuery.java:665)
> 	at
org.apache.openjpa.datacache.QueryCacheStoreQuery$QueryCacheExecutor.exe
cuteDelete(QueryCacheStoreQuery.java:348)
> 	at
org.apache.openjpa.kernel.QueryImpl.delete(QueryImpl.java:1012)
> 	at
org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:768)
> 	at
org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:831)
> 	at
org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:827)
> 	at
org.apache.openjpa.kernel.DelegatingQuery.deleteAll(DelegatingQuery.java
:544)
> 	at
org.apache.openjpa.persistence.QueryImpl.executeUpdate(QueryImpl.java:29
9)
> 	at control.Test.clear(Test.java:87)
> 	at control.Test.run(Test.java:37)
> 	at control.Test.main(Test.java:178)
> Caused by: java.lang.ClassCastException:
org.apache.openjpa.datacache.QueryCacheStoreQuery
> 	at
org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.execute
Query(ExpressionStoreQuery.java:651)
> 	at
org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:949)
> 	at
org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.java:1018)
> 	... 11 more

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.

[jira] Updated: (OPENJPA-35) In-memory Delete operation fails with active DataCache

Posted by "Patrick Linskey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-35?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Linskey updated OPENJPA-35:
-----------------------------------

    Fix Version/s: 0.9.7

> In-memory Delete operation fails with active DataCache
> ------------------------------------------------------
>
>                 Key: OPENJPA-35
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-35
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: datacache, query
>    Affects Versions: 0.9.0, 0.9.6
>         Environment: Only happens when DataCache is active
> 			<property name="openjpa.DataCache"                value="true"/>
> 			<property name="openjpa.RemoteCommitProvider"     value="sjvm"/>
>            Reporter: Pinaki Poddar
>            Priority: Critical
>             Fix For: 0.9.7
>
>         Attachments: openjpa-35.test.zip, openjpa-35.trace.txt
>
>
> Delete through query such as 
> 		Query query = em.createQuery("DELETE FROM Node n");
> 		query.executeUpdate();
> fails with following exception (only when DataCache is active)
> Exception in thread "main" <4|false|0.0.0> org.apache.openjpa.persistence.ArgumentException: org.apache.openjpa.datacache.QueryCacheStoreQuery
> 	at org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.java:1029)
> 	at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeDelete(ExpressionStoreQuery.java:665)
> 	at org.apache.openjpa.datacache.QueryCacheStoreQuery$QueryCacheExecutor.executeDelete(QueryCacheStoreQuery.java:348)
> 	at org.apache.openjpa.kernel.QueryImpl.delete(QueryImpl.java:1012)
> 	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:768)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:831)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:827)
> 	at org.apache.openjpa.kernel.DelegatingQuery.deleteAll(DelegatingQuery.java:544)
> 	at org.apache.openjpa.persistence.QueryImpl.executeUpdate(QueryImpl.java:299)
> 	at control.Test.clear(Test.java:87)
> 	at control.Test.run(Test.java:37)
> 	at control.Test.main(Test.java:178)
> Caused by: java.lang.ClassCastException: org.apache.openjpa.datacache.QueryCacheStoreQuery
> 	at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeQuery(ExpressionStoreQuery.java:651)
> 	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:949)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.java:1018)
> 	... 11 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-35) In-memory Delete operation fails with active DataCache

Posted by "Patrick Linskey (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-35?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12476794 ] 

Patrick Linskey commented on OPENJPA-35:
----------------------------------------

Well, I think that it's worth *fixing*, and shouldn't really be all that hard, either. But, assuming that we can't prioritize it appropriately to fix it, we should document it prior to the next release, yes.

> In-memory Delete operation fails with active DataCache
> ------------------------------------------------------
>
>                 Key: OPENJPA-35
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-35
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: datacache, query
>         Environment: Only happens when DataCache is active
> 			<property name="openjpa.DataCache"                value="true"/>
> 			<property name="openjpa.RemoteCommitProvider"     value="sjvm"/>
>            Reporter: Pinaki Poddar
>            Priority: Critical
>         Attachments: openjpa-35.test.zip, openjpa-35.trace.txt
>
>
> Delete through query such as 
> 		Query query = em.createQuery("DELETE FROM Node n");
> 		query.executeUpdate();
> fails with following exception (only when DataCache is active)
> Exception in thread "main" <4|false|0.0.0> org.apache.openjpa.persistence.ArgumentException: org.apache.openjpa.datacache.QueryCacheStoreQuery
> 	at org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.java:1029)
> 	at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeDelete(ExpressionStoreQuery.java:665)
> 	at org.apache.openjpa.datacache.QueryCacheStoreQuery$QueryCacheExecutor.executeDelete(QueryCacheStoreQuery.java:348)
> 	at org.apache.openjpa.kernel.QueryImpl.delete(QueryImpl.java:1012)
> 	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:768)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:831)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:827)
> 	at org.apache.openjpa.kernel.DelegatingQuery.deleteAll(DelegatingQuery.java:544)
> 	at org.apache.openjpa.persistence.QueryImpl.executeUpdate(QueryImpl.java:299)
> 	at control.Test.clear(Test.java:87)
> 	at control.Test.run(Test.java:37)
> 	at control.Test.main(Test.java:178)
> Caused by: java.lang.ClassCastException: org.apache.openjpa.datacache.QueryCacheStoreQuery
> 	at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeQuery(ExpressionStoreQuery.java:651)
> 	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:949)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.java:1018)
> 	... 11 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-35) In-memory Delete operation fails with active DataCache

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-35?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12476808 ] 

Craig Russell commented on OPENJPA-35:
--------------------------------------

I agree this bug is worth fixing and pending the fix, worth documenting as a bug. I'd be against documenting it as a "feature".

> In-memory Delete operation fails with active DataCache
> ------------------------------------------------------
>
>                 Key: OPENJPA-35
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-35
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: datacache, query
>    Affects Versions: 0.9.0, 0.9.6
>         Environment: Only happens when DataCache is active
> 			<property name="openjpa.DataCache"                value="true"/>
> 			<property name="openjpa.RemoteCommitProvider"     value="sjvm"/>
>            Reporter: Pinaki Poddar
>            Priority: Critical
>             Fix For: 0.9.7
>
>         Attachments: openjpa-35.test.zip, openjpa-35.trace.txt
>
>
> Delete through query such as 
> 		Query query = em.createQuery("DELETE FROM Node n");
> 		query.executeUpdate();
> fails with following exception (only when DataCache is active)
> Exception in thread "main" <4|false|0.0.0> org.apache.openjpa.persistence.ArgumentException: org.apache.openjpa.datacache.QueryCacheStoreQuery
> 	at org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.java:1029)
> 	at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeDelete(ExpressionStoreQuery.java:665)
> 	at org.apache.openjpa.datacache.QueryCacheStoreQuery$QueryCacheExecutor.executeDelete(QueryCacheStoreQuery.java:348)
> 	at org.apache.openjpa.kernel.QueryImpl.delete(QueryImpl.java:1012)
> 	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:768)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:831)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:827)
> 	at org.apache.openjpa.kernel.DelegatingQuery.deleteAll(DelegatingQuery.java:544)
> 	at org.apache.openjpa.persistence.QueryImpl.executeUpdate(QueryImpl.java:299)
> 	at control.Test.clear(Test.java:87)
> 	at control.Test.run(Test.java:37)
> 	at control.Test.main(Test.java:178)
> Caused by: java.lang.ClassCastException: org.apache.openjpa.datacache.QueryCacheStoreQuery
> 	at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeQuery(ExpressionStoreQuery.java:651)
> 	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:949)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.java:1018)
> 	... 11 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-35) In-memory Delete operation fails with active DataCache

Posted by "Pinaki Poddar (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-35?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12476790 ] 

Pinaki Poddar commented on OPENJPA-35:
--------------------------------------

Right -- a newly looked up copy (the copy comes out of L2 cache and not from the database where it really do not exist anymore) -- is essentially not usable i.e. any commit set containing that object fails. The L2 cache heals as soon as the commit fails.  

So let me summarize 
a) delete via query leaves a copy in the L2 cache
b) the cached copy can be located via em.find()
c) however, any modify operation on this ghost copy will fail
d) this failure will signal to clear the copy from the L2 cache.

Do you think, it is worth mentioning in the doc?
   

> In-memory Delete operation fails with active DataCache
> ------------------------------------------------------
>
>                 Key: OPENJPA-35
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-35
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: datacache, query
>         Environment: Only happens when DataCache is active
> 			<property name="openjpa.DataCache"                value="true"/>
> 			<property name="openjpa.RemoteCommitProvider"     value="sjvm"/>
>            Reporter: Pinaki Poddar
>            Priority: Critical
>         Attachments: openjpa-35.test.zip, openjpa-35.trace.txt
>
>
> Delete through query such as 
> 		Query query = em.createQuery("DELETE FROM Node n");
> 		query.executeUpdate();
> fails with following exception (only when DataCache is active)
> Exception in thread "main" <4|false|0.0.0> org.apache.openjpa.persistence.ArgumentException: org.apache.openjpa.datacache.QueryCacheStoreQuery
> 	at org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.java:1029)
> 	at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeDelete(ExpressionStoreQuery.java:665)
> 	at org.apache.openjpa.datacache.QueryCacheStoreQuery$QueryCacheExecutor.executeDelete(QueryCacheStoreQuery.java:348)
> 	at org.apache.openjpa.kernel.QueryImpl.delete(QueryImpl.java:1012)
> 	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:768)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:831)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:827)
> 	at org.apache.openjpa.kernel.DelegatingQuery.deleteAll(DelegatingQuery.java:544)
> 	at org.apache.openjpa.persistence.QueryImpl.executeUpdate(QueryImpl.java:299)
> 	at control.Test.clear(Test.java:87)
> 	at control.Test.run(Test.java:37)
> 	at control.Test.main(Test.java:178)
> Caused by: java.lang.ClassCastException: org.apache.openjpa.datacache.QueryCacheStoreQuery
> 	at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeQuery(ExpressionStoreQuery.java:651)
> 	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:949)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.java:1018)
> 	... 11 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-35) In-memory Delete operation fails with active DataCache

Posted by "Pinaki Poddar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-35?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pinaki Poddar updated OPENJPA-35:
---------------------------------

    Attachment: openjpa-35.test.zip

Attached test case shows that after deleting via query, L2 cache still maintains a copy and em.find() finds the instance. 

> In-memory Delete operation fails with active DataCache
> ------------------------------------------------------
>
>                 Key: OPENJPA-35
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-35
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: datacache, query
>         Environment: Only happens when DataCache is active
> 			<property name="openjpa.DataCache"                value="true"/>
> 			<property name="openjpa.RemoteCommitProvider"     value="sjvm"/>
>            Reporter: Pinaki Poddar
>            Priority: Critical
>         Attachments: openjpa-35.test.zip
>
>
> Delete through query such as 
> 		Query query = em.createQuery("DELETE FROM Node n");
> 		query.executeUpdate();
> fails with following exception (only when DataCache is active)
> Exception in thread "main" <4|false|0.0.0> org.apache.openjpa.persistence.ArgumentException: org.apache.openjpa.datacache.QueryCacheStoreQuery
> 	at org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.java:1029)
> 	at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeDelete(ExpressionStoreQuery.java:665)
> 	at org.apache.openjpa.datacache.QueryCacheStoreQuery$QueryCacheExecutor.executeDelete(QueryCacheStoreQuery.java:348)
> 	at org.apache.openjpa.kernel.QueryImpl.delete(QueryImpl.java:1012)
> 	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:768)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:831)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:827)
> 	at org.apache.openjpa.kernel.DelegatingQuery.deleteAll(DelegatingQuery.java:544)
> 	at org.apache.openjpa.persistence.QueryImpl.executeUpdate(QueryImpl.java:299)
> 	at control.Test.clear(Test.java:87)
> 	at control.Test.run(Test.java:37)
> 	at control.Test.main(Test.java:178)
> Caused by: java.lang.ClassCastException: org.apache.openjpa.datacache.QueryCacheStoreQuery
> 	at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeQuery(ExpressionStoreQuery.java:651)
> 	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:949)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.java:1018)
> 	... 11 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-35) In-memory Delete operation fails with active DataCache

Posted by "Patrick Linskey (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-35?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12479277 ] 

Patrick Linskey commented on OPENJPA-35:
----------------------------------------

> b) When openjpa.datacache=false, the application can still obtain a 
> non-null reference to StoreCache, however its delegate is null.
> What should OpenJPAEntityManagerFactory.getStoreCache() return
> when  openjpa.datacache=false ?

I think that this is fine behavior. You generally shouldn't need to get the StoreCache's delegate. The current behavior is nice because user code doesn't need to check whether or not a cache is active; instead, user code can just perform cache operations. Sure, they're no-ops when the cache isn't on, but that's fine.

> In-memory Delete operation fails with active DataCache
> ------------------------------------------------------
>
>                 Key: OPENJPA-35
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-35
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: datacache, query
>    Affects Versions: 0.9.0, 0.9.6
>         Environment: Only happens when DataCache is active
> 			<property name="openjpa.DataCache"                value="true"/>
> 			<property name="openjpa.RemoteCommitProvider"     value="sjvm"/>
>            Reporter: Pinaki Poddar
>            Priority: Critical
>             Fix For: 0.9.7
>
>         Attachments: openjpa-35.test.zip, openjpa-35.trace.txt
>
>
> Delete through query such as 
> 		Query query = em.createQuery("DELETE FROM Node n");
> 		query.executeUpdate();
> fails with following exception (only when DataCache is active)
> Exception in thread "main" <4|false|0.0.0> org.apache.openjpa.persistence.ArgumentException: org.apache.openjpa.datacache.QueryCacheStoreQuery
> 	at org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.java:1029)
> 	at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeDelete(ExpressionStoreQuery.java:665)
> 	at org.apache.openjpa.datacache.QueryCacheStoreQuery$QueryCacheExecutor.executeDelete(QueryCacheStoreQuery.java:348)
> 	at org.apache.openjpa.kernel.QueryImpl.delete(QueryImpl.java:1012)
> 	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:768)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:831)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:827)
> 	at org.apache.openjpa.kernel.DelegatingQuery.deleteAll(DelegatingQuery.java:544)
> 	at org.apache.openjpa.persistence.QueryImpl.executeUpdate(QueryImpl.java:299)
> 	at control.Test.clear(Test.java:87)
> 	at control.Test.run(Test.java:37)
> 	at control.Test.main(Test.java:178)
> Caused by: java.lang.ClassCastException: org.apache.openjpa.datacache.QueryCacheStoreQuery
> 	at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeQuery(ExpressionStoreQuery.java:651)
> 	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:949)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.java:1018)
> 	... 11 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-35) In-memory Delete operation fails with active DataCache

Posted by "Patrick Linskey (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-35?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12476774 ] 

Patrick Linskey commented on OPENJPA-35:
----------------------------------------

... to finish that thought, I'd then expect that the instance would get cleared from the cache due to the optimistic lock failure, and a second transaction involving the instance (a newly-looked-up copy) would succeed.

> In-memory Delete operation fails with active DataCache
> ------------------------------------------------------
>
>                 Key: OPENJPA-35
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-35
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: datacache, query
>         Environment: Only happens when DataCache is active
> 			<property name="openjpa.DataCache"                value="true"/>
> 			<property name="openjpa.RemoteCommitProvider"     value="sjvm"/>
>            Reporter: Pinaki Poddar
>            Priority: Critical
>         Attachments: openjpa-35.test.zip, openjpa-35.trace.txt
>
>
> Delete through query such as 
> 		Query query = em.createQuery("DELETE FROM Node n");
> 		query.executeUpdate();
> fails with following exception (only when DataCache is active)
> Exception in thread "main" <4|false|0.0.0> org.apache.openjpa.persistence.ArgumentException: org.apache.openjpa.datacache.QueryCacheStoreQuery
> 	at org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.java:1029)
> 	at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeDelete(ExpressionStoreQuery.java:665)
> 	at org.apache.openjpa.datacache.QueryCacheStoreQuery$QueryCacheExecutor.executeDelete(QueryCacheStoreQuery.java:348)
> 	at org.apache.openjpa.kernel.QueryImpl.delete(QueryImpl.java:1012)
> 	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:768)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:831)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:827)
> 	at org.apache.openjpa.kernel.DelegatingQuery.deleteAll(DelegatingQuery.java:544)
> 	at org.apache.openjpa.persistence.QueryImpl.executeUpdate(QueryImpl.java:299)
> 	at control.Test.clear(Test.java:87)
> 	at control.Test.run(Test.java:37)
> 	at control.Test.main(Test.java:178)
> Caused by: java.lang.ClassCastException: org.apache.openjpa.datacache.QueryCacheStoreQuery
> 	at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeQuery(ExpressionStoreQuery.java:651)
> 	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:949)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.java:1018)
> 	... 11 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-35) In-memory Delete operation fails with active DataCache

Posted by "Patrick Linskey (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-35?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12476773 ] 

Patrick Linskey commented on OPENJPA-35:
----------------------------------------

I haven't looked at your test, but I'm guessing that since it has a DetachedStateManager, it's the same instance that you had been using earlier.

I would expect that if you deleted some instances with a bulk delete, then looked up an instance that had been deleted via a data cache hit, then tried to do anything involving a lock with that instance, you'd get a failure at commit time (assuming optimistic transactions and a @Version column).

> In-memory Delete operation fails with active DataCache
> ------------------------------------------------------
>
>                 Key: OPENJPA-35
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-35
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: datacache, query
>         Environment: Only happens when DataCache is active
> 			<property name="openjpa.DataCache"                value="true"/>
> 			<property name="openjpa.RemoteCommitProvider"     value="sjvm"/>
>            Reporter: Pinaki Poddar
>            Priority: Critical
>         Attachments: openjpa-35.test.zip, openjpa-35.trace.txt
>
>
> Delete through query such as 
> 		Query query = em.createQuery("DELETE FROM Node n");
> 		query.executeUpdate();
> fails with following exception (only when DataCache is active)
> Exception in thread "main" <4|false|0.0.0> org.apache.openjpa.persistence.ArgumentException: org.apache.openjpa.datacache.QueryCacheStoreQuery
> 	at org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.java:1029)
> 	at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeDelete(ExpressionStoreQuery.java:665)
> 	at org.apache.openjpa.datacache.QueryCacheStoreQuery$QueryCacheExecutor.executeDelete(QueryCacheStoreQuery.java:348)
> 	at org.apache.openjpa.kernel.QueryImpl.delete(QueryImpl.java:1012)
> 	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:768)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:831)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:827)
> 	at org.apache.openjpa.kernel.DelegatingQuery.deleteAll(DelegatingQuery.java:544)
> 	at org.apache.openjpa.persistence.QueryImpl.executeUpdate(QueryImpl.java:299)
> 	at control.Test.clear(Test.java:87)
> 	at control.Test.run(Test.java:37)
> 	at control.Test.main(Test.java:178)
> Caused by: java.lang.ClassCastException: org.apache.openjpa.datacache.QueryCacheStoreQuery
> 	at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeQuery(ExpressionStoreQuery.java:651)
> 	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:949)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.java:1018)
> 	... 11 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-35) In-memory Delete operation fails with active DataCache

Posted by "Patrick Linskey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-35?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Linskey updated OPENJPA-35:
-----------------------------------

    Affects Version/s: 0.9.0

> In-memory Delete operation fails with active DataCache
> ------------------------------------------------------
>
>                 Key: OPENJPA-35
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-35
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: datacache, query
>    Affects Versions: 0.9.0, 0.9.6
>         Environment: Only happens when DataCache is active
> 			<property name="openjpa.DataCache"                value="true"/>
> 			<property name="openjpa.RemoteCommitProvider"     value="sjvm"/>
>            Reporter: Pinaki Poddar
>            Priority: Critical
>             Fix For: 0.9.7
>
>         Attachments: openjpa-35.test.zip, openjpa-35.trace.txt
>
>
> Delete through query such as 
> 		Query query = em.createQuery("DELETE FROM Node n");
> 		query.executeUpdate();
> fails with following exception (only when DataCache is active)
> Exception in thread "main" <4|false|0.0.0> org.apache.openjpa.persistence.ArgumentException: org.apache.openjpa.datacache.QueryCacheStoreQuery
> 	at org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.java:1029)
> 	at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeDelete(ExpressionStoreQuery.java:665)
> 	at org.apache.openjpa.datacache.QueryCacheStoreQuery$QueryCacheExecutor.executeDelete(QueryCacheStoreQuery.java:348)
> 	at org.apache.openjpa.kernel.QueryImpl.delete(QueryImpl.java:1012)
> 	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:768)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:831)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:827)
> 	at org.apache.openjpa.kernel.DelegatingQuery.deleteAll(DelegatingQuery.java:544)
> 	at org.apache.openjpa.persistence.QueryImpl.executeUpdate(QueryImpl.java:299)
> 	at control.Test.clear(Test.java:87)
> 	at control.Test.run(Test.java:37)
> 	at control.Test.main(Test.java:178)
> Caused by: java.lang.ClassCastException: org.apache.openjpa.datacache.QueryCacheStoreQuery
> 	at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeQuery(ExpressionStoreQuery.java:651)
> 	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:949)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.java:1018)
> 	... 11 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-35) In-memory Delete operation fails with active DataCache

Posted by "Pinaki Poddar (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-35?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12476719 ] 

Pinaki Poddar commented on OPENJPA-35:
--------------------------------------

I am not seeing this particular error anymore -- but I am seeing something else that does not appear right. 

a) When datacache is active, even after an instance is deleted via query, the entitymanager is committed and cleared, EntityManager find() finds the instance -- not from its L1 cache but from its L2 cache.

If this is a known limitation -- it should be documented (could not find it in OpenJPA User's guide)

b) When openjpa.datacache=false, the application can still obtain a non-null reference to StoreCache, however its delegate is null.
What should OpenJPAEntityManagerFactory.getStoreCache() return when  openjpa.datacache=false ?

c) delete directly i.e. em.remove() does the 'right' thing i.e. subsequent em.find() returns null. 

d) Setting "openjpa.BrokerImpl" to "EvictFromDataCache=true" did not change the behavior (nor was expected)

The observations are based on the attached TestCase

> In-memory Delete operation fails with active DataCache
> ------------------------------------------------------
>
>                 Key: OPENJPA-35
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-35
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: datacache, query
>         Environment: Only happens when DataCache is active
> 			<property name="openjpa.DataCache"                value="true"/>
> 			<property name="openjpa.RemoteCommitProvider"     value="sjvm"/>
>            Reporter: Pinaki Poddar
>            Priority: Critical
>
> Delete through query such as 
> 		Query query = em.createQuery("DELETE FROM Node n");
> 		query.executeUpdate();
> fails with following exception (only when DataCache is active)
> Exception in thread "main" <4|false|0.0.0> org.apache.openjpa.persistence.ArgumentException: org.apache.openjpa.datacache.QueryCacheStoreQuery
> 	at org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.java:1029)
> 	at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeDelete(ExpressionStoreQuery.java:665)
> 	at org.apache.openjpa.datacache.QueryCacheStoreQuery$QueryCacheExecutor.executeDelete(QueryCacheStoreQuery.java:348)
> 	at org.apache.openjpa.kernel.QueryImpl.delete(QueryImpl.java:1012)
> 	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:768)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:831)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:827)
> 	at org.apache.openjpa.kernel.DelegatingQuery.deleteAll(DelegatingQuery.java:544)
> 	at org.apache.openjpa.persistence.QueryImpl.executeUpdate(QueryImpl.java:299)
> 	at control.Test.clear(Test.java:87)
> 	at control.Test.run(Test.java:37)
> 	at control.Test.main(Test.java:178)
> Caused by: java.lang.ClassCastException: org.apache.openjpa.datacache.QueryCacheStoreQuery
> 	at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeQuery(ExpressionStoreQuery.java:651)
> 	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:949)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.java:1018)
> 	... 11 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-35) In-memory Delete operation fails with active DataCache

Posted by "Patrick Linskey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-35?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Linskey updated OPENJPA-35:
-----------------------------------

    Priority: Critical  (was: Major)

> In-memory Delete operation fails with active DataCache
> ------------------------------------------------------
>
>                 Key: OPENJPA-35
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-35
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: datacache, query
>         Environment: Only happens when DataCache is active
> 			<property name="openjpa.DataCache"                value="true"/>
> 			<property name="openjpa.RemoteCommitProvider"     value="sjvm"/>
>            Reporter: Pinaki Poddar
>            Priority: Critical
>
> Delete through query such as 
> 		Query query = em.createQuery("DELETE FROM Node n");
> 		query.executeUpdate();
> fails with following exception (only when DataCache is active)
> Exception in thread "main" <4|false|0.0.0> org.apache.openjpa.persistence.ArgumentException: org.apache.openjpa.datacache.QueryCacheStoreQuery
> 	at org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.java:1029)
> 	at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeDelete(ExpressionStoreQuery.java:665)
> 	at org.apache.openjpa.datacache.QueryCacheStoreQuery$QueryCacheExecutor.executeDelete(QueryCacheStoreQuery.java:348)
> 	at org.apache.openjpa.kernel.QueryImpl.delete(QueryImpl.java:1012)
> 	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:768)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:831)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:827)
> 	at org.apache.openjpa.kernel.DelegatingQuery.deleteAll(DelegatingQuery.java:544)
> 	at org.apache.openjpa.persistence.QueryImpl.executeUpdate(QueryImpl.java:299)
> 	at control.Test.clear(Test.java:87)
> 	at control.Test.run(Test.java:37)
> 	at control.Test.main(Test.java:178)
> Caused by: java.lang.ClassCastException: org.apache.openjpa.datacache.QueryCacheStoreQuery
> 	at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeQuery(ExpressionStoreQuery.java:651)
> 	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:949)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.java:1018)
> 	... 11 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (OPENJPA-35) In-memory Delete operation fails with active DataCache

Posted by "Patrick Linskey (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-35?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12476732 ] 

Patrick Linskey commented on OPENJPA-35:
----------------------------------------

What happens if the user modifies the object or if the user obtains a read lock on the instance?

> In-memory Delete operation fails with active DataCache
> ------------------------------------------------------
>
>                 Key: OPENJPA-35
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-35
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: datacache, query
>         Environment: Only happens when DataCache is active
> 			<property name="openjpa.DataCache"                value="true"/>
> 			<property name="openjpa.RemoteCommitProvider"     value="sjvm"/>
>            Reporter: Pinaki Poddar
>            Priority: Critical
>         Attachments: openjpa-35.test.zip
>
>
> Delete through query such as 
> 		Query query = em.createQuery("DELETE FROM Node n");
> 		query.executeUpdate();
> fails with following exception (only when DataCache is active)
> Exception in thread "main" <4|false|0.0.0> org.apache.openjpa.persistence.ArgumentException: org.apache.openjpa.datacache.QueryCacheStoreQuery
> 	at org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.java:1029)
> 	at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeDelete(ExpressionStoreQuery.java:665)
> 	at org.apache.openjpa.datacache.QueryCacheStoreQuery$QueryCacheExecutor.executeDelete(QueryCacheStoreQuery.java:348)
> 	at org.apache.openjpa.kernel.QueryImpl.delete(QueryImpl.java:1012)
> 	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:768)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:831)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:827)
> 	at org.apache.openjpa.kernel.DelegatingQuery.deleteAll(DelegatingQuery.java:544)
> 	at org.apache.openjpa.persistence.QueryImpl.executeUpdate(QueryImpl.java:299)
> 	at control.Test.clear(Test.java:87)
> 	at control.Test.run(Test.java:37)
> 	at control.Test.main(Test.java:178)
> Caused by: java.lang.ClassCastException: org.apache.openjpa.datacache.QueryCacheStoreQuery
> 	at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeQuery(ExpressionStoreQuery.java:651)
> 	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:949)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.java:1018)
> 	... 11 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-35) In-memory Delete operation fails with active DataCache

Posted by "Patrick Linskey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-35?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Linskey updated OPENJPA-35:
-----------------------------------

        Fix Version/s: 0.9.7
    Affects Version/s: 0.9.6

> In-memory Delete operation fails with active DataCache
> ------------------------------------------------------
>
>                 Key: OPENJPA-35
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-35
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: datacache, query
>    Affects Versions: 0.9.0, 0.9.6
>         Environment: Only happens when DataCache is active
> 			<property name="openjpa.DataCache"                value="true"/>
> 			<property name="openjpa.RemoteCommitProvider"     value="sjvm"/>
>            Reporter: Pinaki Poddar
>            Priority: Critical
>             Fix For: 0.9.7
>
>         Attachments: openjpa-35.test.zip, openjpa-35.trace.txt
>
>
> Delete through query such as 
> 		Query query = em.createQuery("DELETE FROM Node n");
> 		query.executeUpdate();
> fails with following exception (only when DataCache is active)
> Exception in thread "main" <4|false|0.0.0> org.apache.openjpa.persistence.ArgumentException: org.apache.openjpa.datacache.QueryCacheStoreQuery
> 	at org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.java:1029)
> 	at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeDelete(ExpressionStoreQuery.java:665)
> 	at org.apache.openjpa.datacache.QueryCacheStoreQuery$QueryCacheExecutor.executeDelete(QueryCacheStoreQuery.java:348)
> 	at org.apache.openjpa.kernel.QueryImpl.delete(QueryImpl.java:1012)
> 	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:768)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:831)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:827)
> 	at org.apache.openjpa.kernel.DelegatingQuery.deleteAll(DelegatingQuery.java:544)
> 	at org.apache.openjpa.persistence.QueryImpl.executeUpdate(QueryImpl.java:299)
> 	at control.Test.clear(Test.java:87)
> 	at control.Test.run(Test.java:37)
> 	at control.Test.main(Test.java:178)
> Caused by: java.lang.ClassCastException: org.apache.openjpa.datacache.QueryCacheStoreQuery
> 	at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeQuery(ExpressionStoreQuery.java:651)
> 	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:949)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.java:1018)
> 	... 11 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (OPENJPA-35) In-memory Delete operation fails with active DataCache

Posted by "Patrick Linskey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-35?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Linskey resolved OPENJPA-35.
------------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: 0.9.7)

> In-memory Delete operation fails with active DataCache
> ------------------------------------------------------
>
>                 Key: OPENJPA-35
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-35
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: datacache, query
>    Affects Versions: 0.9.0, 0.9.6
>         Environment: Only happens when DataCache is active
> 			<property name="openjpa.DataCache"                value="true"/>
> 			<property name="openjpa.RemoteCommitProvider"     value="sjvm"/>
>            Reporter: Pinaki Poddar
>            Priority: Critical
>         Attachments: openjpa-35.test.zip, openjpa-35.trace.txt
>
>
> Delete through query such as 
> 		Query query = em.createQuery("DELETE FROM Node n");
> 		query.executeUpdate();
> fails with following exception (only when DataCache is active)
> Exception in thread "main" <4|false|0.0.0> org.apache.openjpa.persistence.ArgumentException: org.apache.openjpa.datacache.QueryCacheStoreQuery
> 	at org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.java:1029)
> 	at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeDelete(ExpressionStoreQuery.java:665)
> 	at org.apache.openjpa.datacache.QueryCacheStoreQuery$QueryCacheExecutor.executeDelete(QueryCacheStoreQuery.java:348)
> 	at org.apache.openjpa.kernel.QueryImpl.delete(QueryImpl.java:1012)
> 	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:768)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:831)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:827)
> 	at org.apache.openjpa.kernel.DelegatingQuery.deleteAll(DelegatingQuery.java:544)
> 	at org.apache.openjpa.persistence.QueryImpl.executeUpdate(QueryImpl.java:299)
> 	at control.Test.clear(Test.java:87)
> 	at control.Test.run(Test.java:37)
> 	at control.Test.main(Test.java:178)
> Caused by: java.lang.ClassCastException: org.apache.openjpa.datacache.QueryCacheStoreQuery
> 	at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeQuery(ExpressionStoreQuery.java:651)
> 	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:949)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.java:1018)
> 	... 11 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (OPENJPA-35) In-memory Delete operation fails with active DataCache

Posted by "Pinaki Poddar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-35?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pinaki Poddar updated OPENJPA-35:
---------------------------------

    Attachment: openjpa-35.trace.txt

Added a trace output of the test case that is failing. 

shows that the deleted instance (PObject-4501) is in L2 Cache.

Please note the instance was locked and modified *after* delete by query (as we still has its reference).
Does that give the cache a chance to heal?

Please note that PObject-4501 has a DetachedStateManager when we lock/modify it after delete.


> In-memory Delete operation fails with active DataCache
> ------------------------------------------------------
>
>                 Key: OPENJPA-35
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-35
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: datacache, query
>         Environment: Only happens when DataCache is active
> 			<property name="openjpa.DataCache"                value="true"/>
> 			<property name="openjpa.RemoteCommitProvider"     value="sjvm"/>
>            Reporter: Pinaki Poddar
>            Priority: Critical
>         Attachments: openjpa-35.test.zip, openjpa-35.trace.txt
>
>
> Delete through query such as 
> 		Query query = em.createQuery("DELETE FROM Node n");
> 		query.executeUpdate();
> fails with following exception (only when DataCache is active)
> Exception in thread "main" <4|false|0.0.0> org.apache.openjpa.persistence.ArgumentException: org.apache.openjpa.datacache.QueryCacheStoreQuery
> 	at org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.java:1029)
> 	at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeDelete(ExpressionStoreQuery.java:665)
> 	at org.apache.openjpa.datacache.QueryCacheStoreQuery$QueryCacheExecutor.executeDelete(QueryCacheStoreQuery.java:348)
> 	at org.apache.openjpa.kernel.QueryImpl.delete(QueryImpl.java:1012)
> 	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:768)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:831)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:827)
> 	at org.apache.openjpa.kernel.DelegatingQuery.deleteAll(DelegatingQuery.java:544)
> 	at org.apache.openjpa.persistence.QueryImpl.executeUpdate(QueryImpl.java:299)
> 	at control.Test.clear(Test.java:87)
> 	at control.Test.run(Test.java:37)
> 	at control.Test.main(Test.java:178)
> Caused by: java.lang.ClassCastException: org.apache.openjpa.datacache.QueryCacheStoreQuery
> 	at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeQuery(ExpressionStoreQuery.java:651)
> 	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:949)
> 	at org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.java:1018)
> 	... 11 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.