You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Reinhard Dunst <re...@tub.at> on 2003/03/06 03:58:05 UTC

Having Clause with OJB

Hi,

how can I realize this SQL statement with OJB

  select company_id 
  from companyattributes
  where attribute_id in (35,16,24) 
  group by company_id 
  having count(company_id) = 3

does anybody have an idea

thanks in advance
Reinhard

Re: ODMG recursive locking / ConcurrentModificationException

Posted by "V.B. Skrypnyk" <va...@skrypnyk.net>.
Hi Armin,

I just did a cvs diff on the source and this is what I got:

RCS file:
/home/cvspublic/jakarta-ojb/src/java/org/apache/ojb/odmg/ObjectEnvelopeTable
..jav
a,v
retrieving revision 1.18
diff -r1.18 ObjectEnvelopeTable.java
63a64
> import java.util.Vector;
215c216,219
<             iter = mvOrderOfIds.iterator();
---
> Vector tmp = new Vector();
> tmp.addAll( mvOrderOfIds );
>             //iter = mvOrderOfIds.iterator();
> iter = tmp.iterator();

It seems that the source is the same as what I used when the problem came
up. Are you sure that the changed file is ObjectEnvelopeTable.java. Is my
revision right?

--Bill.


----- Original Message -----
From: "Armin Waibel" <ar...@code-au-lait.de>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Friday, March 07, 2003 12:55 AM
Subject: Re: ODMG recursive locking / ConcurrentModificationException


> Hi Bill,
>
> checked in that fix? yesterday after reading your post ;-)
> Would be nice if you could try out my solution
> (changed: ObjectEnvelopeTable.java).
>
> regards,
> Armin
>
> ----- Original Message -----
> From: "V.B. Skrypnyk" <va...@skrypnyk.net>
> To: "OJB Users List" <oj...@db.apache.org>
> Sent: Friday, March 07, 2003 8:21 AM
> Subject: Re: ODMG recursive locking / ConcurrentModificationException
>
>
> > Hi Armin,
> >
> > I modified the code manually by adding the temp vector solution. That
> > worked.
> > If your fix w/o temp vector was checked in the CVS before 2-3 days ago
> > (that's when I encountered it in the newly downloaded CVS version),
> > then the problem still persists.
> >
> > Cheers,
> > --Bill.
> >
> > ----- Original Message -----
> > From: "Armin Waibel" <ar...@code-au-lait.de>
> > To: "OJB Users List" <oj...@db.apache.org>
> > Sent: Thursday, March 06, 2003 12:15 AM
> > Subject: Re: ODMG recursive locking / ConcurrentModificationException
> >
> >
> > > Hi Bill,
> > >
> > > I checked in a fix? in CVS without using a temp vector.
> > > Did this solution works for you?
> > >
> > > regards,
> > > Armin
> > >
> > > ----- Original Message -----
> > > From: "V.B. Skrypnyk" <va...@skrypnyk.net>
> > > To: "OJB Users List" <oj...@db.apache.org>
> > > Sent: Thursday, March 06, 2003 7:32 AM
> > > Subject: Re: ODMG recursive locking /
> ConcurrentModificationException
> > >
> > >
> > > > I just added code for a temporary vector and it worked. The change
> > > below
> > > > must have gotten lost.
> > > > Or was there a problem with the solution?
> > > > --Bill.
> > > >
> > > > ----- Original Message -----
> > > > From: "V.B. Skrypnyk" <va...@skrypnyk.net>
> > > > To: "OJB Users List" <oj...@db.apache.org>
> > > > Sent: Wednesday, March 05, 2003 10:24 PM
> > > > Subject: ODMG recursive locking / ConcurrentModificationException
> > > >
> > > >
> > > > > Hi,
> > > > >
> > > > > I found a thread on the list
> > > > >
> > > >
> > >
> (http://archives.apache.org/eyebrowse/ReadMsg?listName=ojb-user@jakarta.
> > > apac
> > > > > he.org&msgId=593039) in which it is said:
> > > > > >Indeed you stumbled across a bug in the ObjectEnvelopeTable
> class.
> > > The
> > > > > >bug was fixed on 2002/12/23 13:27:59 which means it is not
> > > available on
> > > > > >version 0.9.8. It is however available directly from the cvs
> > > server.
> > > > > >
> > > > > >The Concurrent Modification Exception occurs while upgrading
> the
> > > > > >locks in a commit operation of the ObjectEnvelopeTable class.
> The
> > > > > >solution we came up with was to iterate over temporary vector
> while
> > > > > >upgrading the locks.
> > > > > >
> > > > > >Cheers,
> > > > > >Luis Cruz
> > > > > I have just downloaded the latest cvs version, and I have the
> same
> > > > problem.
> > > > > Did the change get lost by any chance?
> > > > > --Bill
> > > > > My stack trace:
> > > > >      [java] java.util.ConcurrentModificationException     [java]
> > > at
> > > > >
> > >
> java.util.AbstractList$Itr.checkForComodification(AbstractList.java:444)
> > > > > [java] [org.apache.ojb.odmg.ObjectEnvelopeTable] ERROR: Commit
> on
> > > object
> > > > > level failed for tx org.apache.ojb.odmg.TransactionImpl@c9d92c
> > > [java]
> > > > > at java.util.AbstractList$Itr.next(AbstractList.java:417)
> [java]
> > > > at
> > > > >
> > > >
> > >
> org.apache.ojb.odmg.ObjectEnvelopeTable.commitAllEnvelopes(ObjectEnvelop
> > > eTab
> > > > > le.java:218)     [java]     at
> > > > >
> > > >
> > >
> org.apache.ojb.odmg.ObjectEnvelopeTable.commit(ObjectEnvelopeTable.java:
> > > 187)
> > > > > [java] null     [java] [org.apache.ojb.odmg.TransactionImpl]
> ERROR:
> > > Could
> > > > > not prepare for commit: null     [java]     at
> > > > >
> > > >
> > >
> org.apache.ojb.odmg.TransactionImpl.doCommitOnObjects(TransactionImpl.ja
> > > va:3
> > > > > 26)     [java]     at
> > > > >
> > >
> org.apache.ojb.odmg.TransactionImpl.prepare(TransactionImpl.java:575)
> > > > > [java]     at
> > > > >
> org.apache.ojb.odmg.TransactionImpl.commit(TransactionImpl.java:525)
> > > > > [java]     at test.Test.main(Test.java:70)     [java]
> > > > > [org.apache.ojb.broker.accesslayer.ConnectionManagerImpl] INFO:
> > > Rollback
> > > > was
> > > > > called, do rollback on current connection
> > > > > com.p6spy.engine.logging.P6LogConnection@10dc6b5     [java]
> > > > > java.sql.SQLException: General error: Warning:  Some
> > > non-transactional
> > > > > changed tables couldn't be rolled back     [java]     at
> > > > > org.gjt.mm.mysql.MysqlIO.sendCommand(MysqlIO.java:497)
> [java]
> > > > > [org.apache.ojb.broker.accesslayer.ConnectionManagerImpl] ERROR:
> > > Rollback
> > > > on
> > > > > the underlying connection failed     [java]     at
> > > > > org.gjt.mm.mysql.MysqlIO.sqlQueryDirect(MysqlIO.java:550)
> [java]
> > > > at
> > > > > org.gjt.mm.mysql.MysqlIO.sqlQuery(MysqlIO.java:635)     [java]
> > > General
> > > > > error: Warning:  Some non-transactional changed tables couldn't
> be
> > > rolled
> > > > > back     [java]     at
> > > > > org.gjt.mm.mysql.Connection.execSQL(Connection.java:882)
> [java]
> > > at
> > > > > org.gjt.mm.mysql.Connection.execSQL(Connection.java:815)
> [java]
> > > at
> > > > > org.gjt.mm.mysql.Connection.rollback(Connection.java:551)
> [java]
> > > > at
> > > > >
> > > >
> > >
> com.p6spy.engine.logging.P6LogConnection.rollback(P6LogConnection.java:1
> > > 45)
> > > > > [java]     at
> > > > >
> > > >
> > >
> org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.localRollback(Co
> > > nnec
> > > > > tionManagerImpl.java:245)     [java]     at
> > > > >
> > > >
> > >
> org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.abortTransaction(Pe
> > > rsis
> > > > > tenceBrokerImpl.java:358)     [java]     at
> > > > >
> > > >
> > >
> org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.close(PersistenceBr
> > > oker
> > > > > Impl.java:320)     [java]     at
> > > > >
> > > >
> > >
> org.apache.ojb.broker.singlevm.DelegatingPersistenceBroker.close(Delegat
> > > ingP
> > > > > ersistenceBroker.java:132)     [java]     at
> > > > >
> > > >
> > >
> org.apache.ojb.broker.singlevm.PoolablePersistenceBroker.close(PoolableP
> > > ersi
> > > > > stenceBroker.java:28)     [java]     at
> > > > >
> > >
> org.apache.ojb.odmg.TransactionImpl.doClose(TransactionImpl.java:424)
> > > > > [java]     at
> > > > >
> org.apache.ojb.odmg.TransactionImpl.commit(TransactionImpl.java:548)
> > > > > [java]     at test.Test.main(Test.java:70)     [java]
> > > > > org.odmg.TransactionAbortedException     [java]     at
> > > > >
> > > >
> > >
> org.apache.ojb.odmg.ObjectEnvelopeTable.commit(ObjectEnvelopeTable.java:
> > > 198)
> > > > > [java]     at
> > > > >
> > > >
> > >
> org.apache.ojb.odmg.TransactionImpl.doCommitOnObjects(TransactionImpl.ja
> > > va:3
> > > > > 26)     [java]     at
> > > > >
> > >
> org.apache.ojb.odmg.TransactionImpl.prepare(TransactionImpl.java:575)
> > > > > [java]     at
> > > > >
> org.apache.ojb.odmg.TransactionImpl.commit(TransactionImpl.java:525)
> > > > > [java]     at test.Test.main(Test.java:70)     [java] Exception
> in
> > > thread
> > > > > "main"     [java] Java Result: 1
> > > > >
> > > > >
> > > > >
> > > >
> > >
> > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> > > > > For additional commands, e-mail: ojb-user-help@db.apache.org
> > > > >
> > > > >
> > > >
> > > >
> > >
> > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> > > > For additional commands, e-mail: ojb-user-help@db.apache.org
> > > >
> > > >
> > > >
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> > > For additional commands, e-mail: ojb-user-help@db.apache.org
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> > For additional commands, e-mail: ojb-user-help@db.apache.org
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>


Re: ODMG recursive locking / ConcurrentModificationException

Posted by Armin Waibel <ar...@code-au-lait.de>.
Hi Bill,

checked in that fix? yesterday after reading your post ;-)
Would be nice if you could try out my solution
(changed: ObjectEnvelopeTable.java).

regards,
Armin

----- Original Message -----
From: "V.B. Skrypnyk" <va...@skrypnyk.net>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Friday, March 07, 2003 8:21 AM
Subject: Re: ODMG recursive locking / ConcurrentModificationException


> Hi Armin,
>
> I modified the code manually by adding the temp vector solution. That
> worked.
> If your fix w/o temp vector was checked in the CVS before 2-3 days ago
> (that's when I encountered it in the newly downloaded CVS version),
> then the problem still persists.
>
> Cheers,
> --Bill.
>
> ----- Original Message -----
> From: "Armin Waibel" <ar...@code-au-lait.de>
> To: "OJB Users List" <oj...@db.apache.org>
> Sent: Thursday, March 06, 2003 12:15 AM
> Subject: Re: ODMG recursive locking / ConcurrentModificationException
>
>
> > Hi Bill,
> >
> > I checked in a fix? in CVS without using a temp vector.
> > Did this solution works for you?
> >
> > regards,
> > Armin
> >
> > ----- Original Message -----
> > From: "V.B. Skrypnyk" <va...@skrypnyk.net>
> > To: "OJB Users List" <oj...@db.apache.org>
> > Sent: Thursday, March 06, 2003 7:32 AM
> > Subject: Re: ODMG recursive locking /
ConcurrentModificationException
> >
> >
> > > I just added code for a temporary vector and it worked. The change
> > below
> > > must have gotten lost.
> > > Or was there a problem with the solution?
> > > --Bill.
> > >
> > > ----- Original Message -----
> > > From: "V.B. Skrypnyk" <va...@skrypnyk.net>
> > > To: "OJB Users List" <oj...@db.apache.org>
> > > Sent: Wednesday, March 05, 2003 10:24 PM
> > > Subject: ODMG recursive locking / ConcurrentModificationException
> > >
> > >
> > > > Hi,
> > > >
> > > > I found a thread on the list
> > > >
> > >
> >
(http://archives.apache.org/eyebrowse/ReadMsg?listName=ojb-user@jakarta.
> > apac
> > > > he.org&msgId=593039) in which it is said:
> > > > >Indeed you stumbled across a bug in the ObjectEnvelopeTable
class.
> > The
> > > > >bug was fixed on 2002/12/23 13:27:59 which means it is not
> > available on
> > > > >version 0.9.8. It is however available directly from the cvs
> > server.
> > > > >
> > > > >The Concurrent Modification Exception occurs while upgrading
the
> > > > >locks in a commit operation of the ObjectEnvelopeTable class.
The
> > > > >solution we came up with was to iterate over temporary vector
while
> > > > >upgrading the locks.
> > > > >
> > > > >Cheers,
> > > > >Luis Cruz
> > > > I have just downloaded the latest cvs version, and I have the
same
> > > problem.
> > > > Did the change get lost by any chance?
> > > > --Bill
> > > > My stack trace:
> > > >      [java] java.util.ConcurrentModificationException     [java]
> > at
> > > >
> >
java.util.AbstractList$Itr.checkForComodification(AbstractList.java:444)
> > > > [java] [org.apache.ojb.odmg.ObjectEnvelopeTable] ERROR: Commit
on
> > object
> > > > level failed for tx org.apache.ojb.odmg.TransactionImpl@c9d92c
> > [java]
> > > > at java.util.AbstractList$Itr.next(AbstractList.java:417)
[java]
> > > at
> > > >
> > >
> >
org.apache.ojb.odmg.ObjectEnvelopeTable.commitAllEnvelopes(ObjectEnvelop
> > eTab
> > > > le.java:218)     [java]     at
> > > >
> > >
> >
org.apache.ojb.odmg.ObjectEnvelopeTable.commit(ObjectEnvelopeTable.java:
> > 187)
> > > > [java] null     [java] [org.apache.ojb.odmg.TransactionImpl]
ERROR:
> > Could
> > > > not prepare for commit: null     [java]     at
> > > >
> > >
> >
org.apache.ojb.odmg.TransactionImpl.doCommitOnObjects(TransactionImpl.ja
> > va:3
> > > > 26)     [java]     at
> > > >
> >
org.apache.ojb.odmg.TransactionImpl.prepare(TransactionImpl.java:575)
> > > > [java]     at
> > > >
org.apache.ojb.odmg.TransactionImpl.commit(TransactionImpl.java:525)
> > > > [java]     at test.Test.main(Test.java:70)     [java]
> > > > [org.apache.ojb.broker.accesslayer.ConnectionManagerImpl] INFO:
> > Rollback
> > > was
> > > > called, do rollback on current connection
> > > > com.p6spy.engine.logging.P6LogConnection@10dc6b5     [java]
> > > > java.sql.SQLException: General error: Warning:  Some
> > non-transactional
> > > > changed tables couldn't be rolled back     [java]     at
> > > > org.gjt.mm.mysql.MysqlIO.sendCommand(MysqlIO.java:497)
[java]
> > > > [org.apache.ojb.broker.accesslayer.ConnectionManagerImpl] ERROR:
> > Rollback
> > > on
> > > > the underlying connection failed     [java]     at
> > > > org.gjt.mm.mysql.MysqlIO.sqlQueryDirect(MysqlIO.java:550)
[java]
> > > at
> > > > org.gjt.mm.mysql.MysqlIO.sqlQuery(MysqlIO.java:635)     [java]
> > General
> > > > error: Warning:  Some non-transactional changed tables couldn't
be
> > rolled
> > > > back     [java]     at
> > > > org.gjt.mm.mysql.Connection.execSQL(Connection.java:882)
[java]
> > at
> > > > org.gjt.mm.mysql.Connection.execSQL(Connection.java:815)
[java]
> > at
> > > > org.gjt.mm.mysql.Connection.rollback(Connection.java:551)
[java]
> > > at
> > > >
> > >
> >
com.p6spy.engine.logging.P6LogConnection.rollback(P6LogConnection.java:1
> > 45)
> > > > [java]     at
> > > >
> > >
> >
org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.localRollback(Co
> > nnec
> > > > tionManagerImpl.java:245)     [java]     at
> > > >
> > >
> >
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.abortTransaction(Pe
> > rsis
> > > > tenceBrokerImpl.java:358)     [java]     at
> > > >
> > >
> >
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.close(PersistenceBr
> > oker
> > > > Impl.java:320)     [java]     at
> > > >
> > >
> >
org.apache.ojb.broker.singlevm.DelegatingPersistenceBroker.close(Delegat
> > ingP
> > > > ersistenceBroker.java:132)     [java]     at
> > > >
> > >
> >
org.apache.ojb.broker.singlevm.PoolablePersistenceBroker.close(PoolableP
> > ersi
> > > > stenceBroker.java:28)     [java]     at
> > > >
> >
org.apache.ojb.odmg.TransactionImpl.doClose(TransactionImpl.java:424)
> > > > [java]     at
> > > >
org.apache.ojb.odmg.TransactionImpl.commit(TransactionImpl.java:548)
> > > > [java]     at test.Test.main(Test.java:70)     [java]
> > > > org.odmg.TransactionAbortedException     [java]     at
> > > >
> > >
> >
org.apache.ojb.odmg.ObjectEnvelopeTable.commit(ObjectEnvelopeTable.java:
> > 198)
> > > > [java]     at
> > > >
> > >
> >
org.apache.ojb.odmg.TransactionImpl.doCommitOnObjects(TransactionImpl.ja
> > va:3
> > > > 26)     [java]     at
> > > >
> >
org.apache.ojb.odmg.TransactionImpl.prepare(TransactionImpl.java:575)
> > > > [java]     at
> > > >
org.apache.ojb.odmg.TransactionImpl.commit(TransactionImpl.java:525)
> > > > [java]     at test.Test.main(Test.java:70)     [java] Exception
in
> > thread
> > > > "main"     [java] Java Result: 1
> > > >
> > > >
> > > >
> > >
> >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> > > > For additional commands, e-mail: ojb-user-help@db.apache.org
> > > >
> > > >
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> > > For additional commands, e-mail: ojb-user-help@db.apache.org
> > >
> > >
> > >
> >
> >
>
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> > For additional commands, e-mail: ojb-user-help@db.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>


Re: ODMG recursive locking / ConcurrentModificationException

Posted by "V.B. Skrypnyk" <va...@skrypnyk.net>.
Hi Armin,

I modified the code manually by adding the temp vector solution. That
worked.
If your fix w/o temp vector was checked in the CVS before 2-3 days ago
(that's when I encountered it in the newly downloaded CVS version),
then the problem still persists.

Cheers,
--Bill.

----- Original Message -----
From: "Armin Waibel" <ar...@code-au-lait.de>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Thursday, March 06, 2003 12:15 AM
Subject: Re: ODMG recursive locking / ConcurrentModificationException


> Hi Bill,
>
> I checked in a fix? in CVS without using a temp vector.
> Did this solution works for you?
>
> regards,
> Armin
>
> ----- Original Message -----
> From: "V.B. Skrypnyk" <va...@skrypnyk.net>
> To: "OJB Users List" <oj...@db.apache.org>
> Sent: Thursday, March 06, 2003 7:32 AM
> Subject: Re: ODMG recursive locking / ConcurrentModificationException
>
>
> > I just added code for a temporary vector and it worked. The change
> below
> > must have gotten lost.
> > Or was there a problem with the solution?
> > --Bill.
> >
> > ----- Original Message -----
> > From: "V.B. Skrypnyk" <va...@skrypnyk.net>
> > To: "OJB Users List" <oj...@db.apache.org>
> > Sent: Wednesday, March 05, 2003 10:24 PM
> > Subject: ODMG recursive locking / ConcurrentModificationException
> >
> >
> > > Hi,
> > >
> > > I found a thread on the list
> > >
> >
> (http://archives.apache.org/eyebrowse/ReadMsg?listName=ojb-user@jakarta.
> apac
> > > he.org&msgId=593039) in which it is said:
> > > >Indeed you stumbled across a bug in the ObjectEnvelopeTable class.
> The
> > > >bug was fixed on 2002/12/23 13:27:59 which means it is not
> available on
> > > >version 0.9.8. It is however available directly from the cvs
> server.
> > > >
> > > >The Concurrent Modification Exception occurs while upgrading the
> > > >locks in a commit operation of the ObjectEnvelopeTable class. The
> > > >solution we came up with was to iterate over temporary vector while
> > > >upgrading the locks.
> > > >
> > > >Cheers,
> > > >Luis Cruz
> > > I have just downloaded the latest cvs version, and I have the same
> > problem.
> > > Did the change get lost by any chance?
> > > --Bill
> > > My stack trace:
> > >      [java] java.util.ConcurrentModificationException     [java]
> at
> > >
> java.util.AbstractList$Itr.checkForComodification(AbstractList.java:444)
> > > [java] [org.apache.ojb.odmg.ObjectEnvelopeTable] ERROR: Commit on
> object
> > > level failed for tx org.apache.ojb.odmg.TransactionImpl@c9d92c
> [java]
> > > at java.util.AbstractList$Itr.next(AbstractList.java:417)     [java]
> > at
> > >
> >
> org.apache.ojb.odmg.ObjectEnvelopeTable.commitAllEnvelopes(ObjectEnvelop
> eTab
> > > le.java:218)     [java]     at
> > >
> >
> org.apache.ojb.odmg.ObjectEnvelopeTable.commit(ObjectEnvelopeTable.java:
> 187)
> > > [java] null     [java] [org.apache.ojb.odmg.TransactionImpl] ERROR:
> Could
> > > not prepare for commit: null     [java]     at
> > >
> >
> org.apache.ojb.odmg.TransactionImpl.doCommitOnObjects(TransactionImpl.ja
> va:3
> > > 26)     [java]     at
> > >
> org.apache.ojb.odmg.TransactionImpl.prepare(TransactionImpl.java:575)
> > > [java]     at
> > > org.apache.ojb.odmg.TransactionImpl.commit(TransactionImpl.java:525)
> > > [java]     at test.Test.main(Test.java:70)     [java]
> > > [org.apache.ojb.broker.accesslayer.ConnectionManagerImpl] INFO:
> Rollback
> > was
> > > called, do rollback on current connection
> > > com.p6spy.engine.logging.P6LogConnection@10dc6b5     [java]
> > > java.sql.SQLException: General error: Warning:  Some
> non-transactional
> > > changed tables couldn't be rolled back     [java]     at
> > > org.gjt.mm.mysql.MysqlIO.sendCommand(MysqlIO.java:497)     [java]
> > > [org.apache.ojb.broker.accesslayer.ConnectionManagerImpl] ERROR:
> Rollback
> > on
> > > the underlying connection failed     [java]     at
> > > org.gjt.mm.mysql.MysqlIO.sqlQueryDirect(MysqlIO.java:550)     [java]
> > at
> > > org.gjt.mm.mysql.MysqlIO.sqlQuery(MysqlIO.java:635)     [java]
> General
> > > error: Warning:  Some non-transactional changed tables couldn't be
> rolled
> > > back     [java]     at
> > > org.gjt.mm.mysql.Connection.execSQL(Connection.java:882)     [java]
> at
> > > org.gjt.mm.mysql.Connection.execSQL(Connection.java:815)     [java]
> at
> > > org.gjt.mm.mysql.Connection.rollback(Connection.java:551)     [java]
> > at
> > >
> >
> com.p6spy.engine.logging.P6LogConnection.rollback(P6LogConnection.java:1
> 45)
> > > [java]     at
> > >
> >
> org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.localRollback(Co
> nnec
> > > tionManagerImpl.java:245)     [java]     at
> > >
> >
> org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.abortTransaction(Pe
> rsis
> > > tenceBrokerImpl.java:358)     [java]     at
> > >
> >
> org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.close(PersistenceBr
> oker
> > > Impl.java:320)     [java]     at
> > >
> >
> org.apache.ojb.broker.singlevm.DelegatingPersistenceBroker.close(Delegat
> ingP
> > > ersistenceBroker.java:132)     [java]     at
> > >
> >
> org.apache.ojb.broker.singlevm.PoolablePersistenceBroker.close(PoolableP
> ersi
> > > stenceBroker.java:28)     [java]     at
> > >
> org.apache.ojb.odmg.TransactionImpl.doClose(TransactionImpl.java:424)
> > > [java]     at
> > > org.apache.ojb.odmg.TransactionImpl.commit(TransactionImpl.java:548)
> > > [java]     at test.Test.main(Test.java:70)     [java]
> > > org.odmg.TransactionAbortedException     [java]     at
> > >
> >
> org.apache.ojb.odmg.ObjectEnvelopeTable.commit(ObjectEnvelopeTable.java:
> 198)
> > > [java]     at
> > >
> >
> org.apache.ojb.odmg.TransactionImpl.doCommitOnObjects(TransactionImpl.ja
> va:3
> > > 26)     [java]     at
> > >
> org.apache.ojb.odmg.TransactionImpl.prepare(TransactionImpl.java:575)
> > > [java]     at
> > > org.apache.ojb.odmg.TransactionImpl.commit(TransactionImpl.java:525)
> > > [java]     at test.Test.main(Test.java:70)     [java] Exception in
> thread
> > > "main"     [java] Java Result: 1
> > >
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> > > For additional commands, e-mail: ojb-user-help@db.apache.org
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> > For additional commands, e-mail: ojb-user-help@db.apache.org
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>


Re: ODMG recursive locking / ConcurrentModificationException

Posted by Armin Waibel <ar...@code-au-lait.de>.
Hi Bill,

I checked in a fix? in CVS without using a temp vector.
Did this solution works for you?

regards,
Armin

----- Original Message -----
From: "V.B. Skrypnyk" <va...@skrypnyk.net>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Thursday, March 06, 2003 7:32 AM
Subject: Re: ODMG recursive locking / ConcurrentModificationException


> I just added code for a temporary vector and it worked. The change
below
> must have gotten lost.
> Or was there a problem with the solution?
> --Bill.
>
> ----- Original Message -----
> From: "V.B. Skrypnyk" <va...@skrypnyk.net>
> To: "OJB Users List" <oj...@db.apache.org>
> Sent: Wednesday, March 05, 2003 10:24 PM
> Subject: ODMG recursive locking / ConcurrentModificationException
>
>
> > Hi,
> >
> > I found a thread on the list
> >
>
(http://archives.apache.org/eyebrowse/ReadMsg?listName=ojb-user@jakarta.
apac
> > he.org&msgId=593039) in which it is said:
> > >Indeed you stumbled across a bug in the ObjectEnvelopeTable class.
The
> > >bug was fixed on 2002/12/23 13:27:59 which means it is not
available on
> > >version 0.9.8. It is however available directly from the cvs
server.
> > >
> > >The Concurrent Modification Exception occurs while upgrading the
> > >locks in a commit operation of the ObjectEnvelopeTable class. The
> > >solution we came up with was to iterate over temporary vector while
> > >upgrading the locks.
> > >
> > >Cheers,
> > >Luis Cruz
> > I have just downloaded the latest cvs version, and I have the same
> problem.
> > Did the change get lost by any chance?
> > --Bill
> > My stack trace:
> >      [java] java.util.ConcurrentModificationException     [java]
at
> >
java.util.AbstractList$Itr.checkForComodification(AbstractList.java:444)
> > [java] [org.apache.ojb.odmg.ObjectEnvelopeTable] ERROR: Commit on
object
> > level failed for tx org.apache.ojb.odmg.TransactionImpl@c9d92c
[java]
> > at java.util.AbstractList$Itr.next(AbstractList.java:417)     [java]
> at
> >
>
org.apache.ojb.odmg.ObjectEnvelopeTable.commitAllEnvelopes(ObjectEnvelop
eTab
> > le.java:218)     [java]     at
> >
>
org.apache.ojb.odmg.ObjectEnvelopeTable.commit(ObjectEnvelopeTable.java:
187)
> > [java] null     [java] [org.apache.ojb.odmg.TransactionImpl] ERROR:
Could
> > not prepare for commit: null     [java]     at
> >
>
org.apache.ojb.odmg.TransactionImpl.doCommitOnObjects(TransactionImpl.ja
va:3
> > 26)     [java]     at
> >
org.apache.ojb.odmg.TransactionImpl.prepare(TransactionImpl.java:575)
> > [java]     at
> > org.apache.ojb.odmg.TransactionImpl.commit(TransactionImpl.java:525)
> > [java]     at test.Test.main(Test.java:70)     [java]
> > [org.apache.ojb.broker.accesslayer.ConnectionManagerImpl] INFO:
Rollback
> was
> > called, do rollback on current connection
> > com.p6spy.engine.logging.P6LogConnection@10dc6b5     [java]
> > java.sql.SQLException: General error: Warning:  Some
non-transactional
> > changed tables couldn't be rolled back     [java]     at
> > org.gjt.mm.mysql.MysqlIO.sendCommand(MysqlIO.java:497)     [java]
> > [org.apache.ojb.broker.accesslayer.ConnectionManagerImpl] ERROR:
Rollback
> on
> > the underlying connection failed     [java]     at
> > org.gjt.mm.mysql.MysqlIO.sqlQueryDirect(MysqlIO.java:550)     [java]
> at
> > org.gjt.mm.mysql.MysqlIO.sqlQuery(MysqlIO.java:635)     [java]
General
> > error: Warning:  Some non-transactional changed tables couldn't be
rolled
> > back     [java]     at
> > org.gjt.mm.mysql.Connection.execSQL(Connection.java:882)     [java]
at
> > org.gjt.mm.mysql.Connection.execSQL(Connection.java:815)     [java]
at
> > org.gjt.mm.mysql.Connection.rollback(Connection.java:551)     [java]
> at
> >
>
com.p6spy.engine.logging.P6LogConnection.rollback(P6LogConnection.java:1
45)
> > [java]     at
> >
>
org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.localRollback(Co
nnec
> > tionManagerImpl.java:245)     [java]     at
> >
>
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.abortTransaction(Pe
rsis
> > tenceBrokerImpl.java:358)     [java]     at
> >
>
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.close(PersistenceBr
oker
> > Impl.java:320)     [java]     at
> >
>
org.apache.ojb.broker.singlevm.DelegatingPersistenceBroker.close(Delegat
ingP
> > ersistenceBroker.java:132)     [java]     at
> >
>
org.apache.ojb.broker.singlevm.PoolablePersistenceBroker.close(PoolableP
ersi
> > stenceBroker.java:28)     [java]     at
> >
org.apache.ojb.odmg.TransactionImpl.doClose(TransactionImpl.java:424)
> > [java]     at
> > org.apache.ojb.odmg.TransactionImpl.commit(TransactionImpl.java:548)
> > [java]     at test.Test.main(Test.java:70)     [java]
> > org.odmg.TransactionAbortedException     [java]     at
> >
>
org.apache.ojb.odmg.ObjectEnvelopeTable.commit(ObjectEnvelopeTable.java:
198)
> > [java]     at
> >
>
org.apache.ojb.odmg.TransactionImpl.doCommitOnObjects(TransactionImpl.ja
va:3
> > 26)     [java]     at
> >
org.apache.ojb.odmg.TransactionImpl.prepare(TransactionImpl.java:575)
> > [java]     at
> > org.apache.ojb.odmg.TransactionImpl.commit(TransactionImpl.java:525)
> > [java]     at test.Test.main(Test.java:70)     [java] Exception in
thread
> > "main"     [java] Java Result: 1
> >
> >
> >
>
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> > For additional commands, e-mail: ojb-user-help@db.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>


Re: ODMG recursive locking / ConcurrentModificationException

Posted by "V.B. Skrypnyk" <va...@skrypnyk.net>.
I just added code for a temporary vector and it worked. The change below
must have gotten lost.
Or was there a problem with the solution?
--Bill.

----- Original Message -----
From: "V.B. Skrypnyk" <va...@skrypnyk.net>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Wednesday, March 05, 2003 10:24 PM
Subject: ODMG recursive locking / ConcurrentModificationException


> Hi,
>
> I found a thread on the list
>
(http://archives.apache.org/eyebrowse/ReadMsg?listName=ojb-user@jakarta.apac
> he.org&msgId=593039) in which it is said:
> >Indeed you stumbled across a bug in the ObjectEnvelopeTable class. The
> >bug was fixed on 2002/12/23 13:27:59 which means it is not available on
> >version 0.9.8. It is however available directly from the cvs server.
> >
> >The Concurrent Modification Exception occurs while upgrading the
> >locks in a commit operation of the ObjectEnvelopeTable class. The
> >solution we came up with was to iterate over temporary vector while
> >upgrading the locks.
> >
> >Cheers,
> >Luis Cruz
> I have just downloaded the latest cvs version, and I have the same
problem.
> Did the change get lost by any chance?
> --Bill
> My stack trace:
>      [java] java.util.ConcurrentModificationException     [java]     at
> java.util.AbstractList$Itr.checkForComodification(AbstractList.java:444)
> [java] [org.apache.ojb.odmg.ObjectEnvelopeTable] ERROR: Commit on object
> level failed for tx org.apache.ojb.odmg.TransactionImpl@c9d92c     [java]
> at java.util.AbstractList$Itr.next(AbstractList.java:417)     [java]
at
>
org.apache.ojb.odmg.ObjectEnvelopeTable.commitAllEnvelopes(ObjectEnvelopeTab
> le.java:218)     [java]     at
>
org.apache.ojb.odmg.ObjectEnvelopeTable.commit(ObjectEnvelopeTable.java:187)
> [java] null     [java] [org.apache.ojb.odmg.TransactionImpl] ERROR: Could
> not prepare for commit: null     [java]     at
>
org.apache.ojb.odmg.TransactionImpl.doCommitOnObjects(TransactionImpl.java:3
> 26)     [java]     at
> org.apache.ojb.odmg.TransactionImpl.prepare(TransactionImpl.java:575)
> [java]     at
> org.apache.ojb.odmg.TransactionImpl.commit(TransactionImpl.java:525)
> [java]     at test.Test.main(Test.java:70)     [java]
> [org.apache.ojb.broker.accesslayer.ConnectionManagerImpl] INFO: Rollback
was
> called, do rollback on current connection
> com.p6spy.engine.logging.P6LogConnection@10dc6b5     [java]
> java.sql.SQLException: General error: Warning:  Some non-transactional
> changed tables couldn't be rolled back     [java]     at
> org.gjt.mm.mysql.MysqlIO.sendCommand(MysqlIO.java:497)     [java]
> [org.apache.ojb.broker.accesslayer.ConnectionManagerImpl] ERROR: Rollback
on
> the underlying connection failed     [java]     at
> org.gjt.mm.mysql.MysqlIO.sqlQueryDirect(MysqlIO.java:550)     [java]
at
> org.gjt.mm.mysql.MysqlIO.sqlQuery(MysqlIO.java:635)     [java] General
> error: Warning:  Some non-transactional changed tables couldn't be rolled
> back     [java]     at
> org.gjt.mm.mysql.Connection.execSQL(Connection.java:882)     [java]     at
> org.gjt.mm.mysql.Connection.execSQL(Connection.java:815)     [java]     at
> org.gjt.mm.mysql.Connection.rollback(Connection.java:551)     [java]
at
>
com.p6spy.engine.logging.P6LogConnection.rollback(P6LogConnection.java:145)
> [java]     at
>
org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.localRollback(Connec
> tionManagerImpl.java:245)     [java]     at
>
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.abortTransaction(Persis
> tenceBrokerImpl.java:358)     [java]     at
>
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.close(PersistenceBroker
> Impl.java:320)     [java]     at
>
org.apache.ojb.broker.singlevm.DelegatingPersistenceBroker.close(DelegatingP
> ersistenceBroker.java:132)     [java]     at
>
org.apache.ojb.broker.singlevm.PoolablePersistenceBroker.close(PoolablePersi
> stenceBroker.java:28)     [java]     at
> org.apache.ojb.odmg.TransactionImpl.doClose(TransactionImpl.java:424)
> [java]     at
> org.apache.ojb.odmg.TransactionImpl.commit(TransactionImpl.java:548)
> [java]     at test.Test.main(Test.java:70)     [java]
> org.odmg.TransactionAbortedException     [java]     at
>
org.apache.ojb.odmg.ObjectEnvelopeTable.commit(ObjectEnvelopeTable.java:198)
> [java]     at
>
org.apache.ojb.odmg.TransactionImpl.doCommitOnObjects(TransactionImpl.java:3
> 26)     [java]     at
> org.apache.ojb.odmg.TransactionImpl.prepare(TransactionImpl.java:575)
> [java]     at
> org.apache.ojb.odmg.TransactionImpl.commit(TransactionImpl.java:525)
> [java]     at test.Test.main(Test.java:70)     [java] Exception in thread
> "main"     [java] Java Result: 1
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>


ODMG recursive locking / ConcurrentModificationException

Posted by "V.B. Skrypnyk" <va...@skrypnyk.net>.
Hi,

I found a thread on the list
(http://archives.apache.org/eyebrowse/ReadMsg?listName=ojb-user@jakarta.apac
he.org&msgId=593039) in which it is said:
>Indeed you stumbled across a bug in the ObjectEnvelopeTable class. The
>bug was fixed on 2002/12/23 13:27:59 which means it is not available on
>version 0.9.8. It is however available directly from the cvs server.
>
>The Concurrent Modification Exception occurs while upgrading the
>locks in a commit operation of the ObjectEnvelopeTable class. The
>solution we came up with was to iterate over temporary vector while
>upgrading the locks.
>
>Cheers,
>Luis Cruz
I have just downloaded the latest cvs version, and I have the same problem.
Did the change get lost by any chance?
--Bill
My stack trace:
     [java] java.util.ConcurrentModificationException     [java]     at
java.util.AbstractList$Itr.checkForComodification(AbstractList.java:444)
[java] [org.apache.ojb.odmg.ObjectEnvelopeTable] ERROR: Commit on object
level failed for tx org.apache.ojb.odmg.TransactionImpl@c9d92c     [java]
at java.util.AbstractList$Itr.next(AbstractList.java:417)     [java]     at
org.apache.ojb.odmg.ObjectEnvelopeTable.commitAllEnvelopes(ObjectEnvelopeTab
le.java:218)     [java]     at
org.apache.ojb.odmg.ObjectEnvelopeTable.commit(ObjectEnvelopeTable.java:187)
[java] null     [java] [org.apache.ojb.odmg.TransactionImpl] ERROR: Could
not prepare for commit: null     [java]     at
org.apache.ojb.odmg.TransactionImpl.doCommitOnObjects(TransactionImpl.java:3
26)     [java]     at
org.apache.ojb.odmg.TransactionImpl.prepare(TransactionImpl.java:575)
[java]     at
org.apache.ojb.odmg.TransactionImpl.commit(TransactionImpl.java:525)
[java]     at test.Test.main(Test.java:70)     [java]
[org.apache.ojb.broker.accesslayer.ConnectionManagerImpl] INFO: Rollback was
called, do rollback on current connection
com.p6spy.engine.logging.P6LogConnection@10dc6b5     [java]
java.sql.SQLException: General error: Warning:  Some non-transactional
changed tables couldn't be rolled back     [java]     at
org.gjt.mm.mysql.MysqlIO.sendCommand(MysqlIO.java:497)     [java]
[org.apache.ojb.broker.accesslayer.ConnectionManagerImpl] ERROR: Rollback on
the underlying connection failed     [java]     at
org.gjt.mm.mysql.MysqlIO.sqlQueryDirect(MysqlIO.java:550)     [java]     at
org.gjt.mm.mysql.MysqlIO.sqlQuery(MysqlIO.java:635)     [java] General
error: Warning:  Some non-transactional changed tables couldn't be rolled
back     [java]     at
org.gjt.mm.mysql.Connection.execSQL(Connection.java:882)     [java]     at
org.gjt.mm.mysql.Connection.execSQL(Connection.java:815)     [java]     at
org.gjt.mm.mysql.Connection.rollback(Connection.java:551)     [java]     at
com.p6spy.engine.logging.P6LogConnection.rollback(P6LogConnection.java:145)
[java]     at
org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.localRollback(Connec
tionManagerImpl.java:245)     [java]     at
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.abortTransaction(Persis
tenceBrokerImpl.java:358)     [java]     at
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.close(PersistenceBroker
Impl.java:320)     [java]     at
org.apache.ojb.broker.singlevm.DelegatingPersistenceBroker.close(DelegatingP
ersistenceBroker.java:132)     [java]     at
org.apache.ojb.broker.singlevm.PoolablePersistenceBroker.close(PoolablePersi
stenceBroker.java:28)     [java]     at
org.apache.ojb.odmg.TransactionImpl.doClose(TransactionImpl.java:424)
[java]     at
org.apache.ojb.odmg.TransactionImpl.commit(TransactionImpl.java:548)
[java]     at test.Test.main(Test.java:70)     [java]
org.odmg.TransactionAbortedException     [java]     at
org.apache.ojb.odmg.ObjectEnvelopeTable.commit(ObjectEnvelopeTable.java:198)
[java]     at
org.apache.ojb.odmg.TransactionImpl.doCommitOnObjects(TransactionImpl.java:3
26)     [java]     at
org.apache.ojb.odmg.TransactionImpl.prepare(TransactionImpl.java:575)
[java]     at
org.apache.ojb.odmg.TransactionImpl.commit(TransactionImpl.java:525)
[java]     at test.Test.main(Test.java:70)     [java] Exception in thread
"main"     [java] Java Result: 1



Re: Interesting (failing) scenario of FKs/PKs in PB

Posted by "V.B. Skrypnyk" <va...@skrypnyk.net>.
Has anyone else encountered this problem?

--Bill.

> Hi,
>
> The following fails to be stored by PersistenceBroker:
>
> I have a class ACL which has two primary keys: objectId and userFK, and
> userFK is also a foreign key tied to a reference of type User. If I do
this:
>
> persistentBroker.beginTransaction();
> ACL acl = new ACL();
> acl.setObjectId( 100 );
> acl.setUser( currentUser );
> persistentBroker.store(acl);
> persistentBroker.commitTransaction();
>
> Acl will not be saved. The reason seems to be because in the storeToDb()
> method of the PersistentBroker, there first comes an assertion of the
> PrimaryKeys and afterwards comes the assignment of all the foreign keys.
In
> the scenario above the assertion of the primary keys will fail, because
the
> userFK has not been assigned yet, so we have an incomplete set of primary
> keys. This does work with the ODMG layer, probably because of a different
> sequence of events during the storing of the object.
>
> I wonder if there should be a check whether a primary key is shared by the
> foreign key and allow that assignment before the assertion of the primary
> keys is performed. Any ideas?
>
> Cheers,
> --Bill.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>


Interesting (failing) scenario of FKs/PKs in PB

Posted by "V.B. Skrypnyk" <va...@skrypnyk.net>.
Hi,

The following fails to be stored by PersistenceBroker:

I have a class ACL which has two primary keys: objectId and userFK, and
userFK is also a foreign key tied to a reference of type User. If I do this:

persistentBroker.beginTransaction();
ACL acl = new ACL();
acl.setObjectId( 100 );
acl.setUser( currentUser );
persistentBroker.store(acl);
persistentBroker.commitTransaction();

Acl will not be saved. The reason seems to be because in the storeToDb()
method of the PersistentBroker, there first comes an assertion of the
PrimaryKeys and afterwards comes the assignment of all the foreign keys. In
the scenario above the assertion of the primary keys will fail, because the
userFK has not been assigned yet, so we have an incomplete set of primary
keys. This does work with the ODMG layer, probably because of a different
sequence of events during the storing of the object.

I wonder if there should be a check whether a primary key is shared by the
foreign key and allow that assignment before the assertion of the primary
keys is performed. Any ideas?

Cheers,
--Bill.


Re: Having Clause with OJB

Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi reinhard,

there's no having clause in ojb so far.

jakob

Reinhard Dunst wrote:

>Hi,
>
>how can I realize this SQL statement with OJB
>
>  select company_id 
>  from companyattributes
>  where attribute_id in (35,16,24) 
>  group by company_id 
>  having count(company_id) = 3
>
>does anybody have an idea
>
>thanks in advance
>Reinhard
>
>  
>