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 Rouven Oberholzer <ro...@2think4u.com> on 2004/03/08 18:40:49 UTC

Problems using Batch Mode with JDK 1.2 (Bug?)

Hi all!

I get following error if I try to switch on the batch mode. I compiled 
the source distribution with jdk 1.2. If I do the same with jdk 1.3 
everything works perfect. Unfortunatly i have to use jdk 1.2 at the 
customer side.

My application is storing a new Object to the database. I'am using the 
odmg interface.

Does anyone have an idea whats going wrong?

My environment:
OJB Version: rc5
JDK Version: 1.2.2_014
Database: Oracle 9i

Stacktrace:
20219   ERROR [main] ObjectEnvelopeTable.commit: Commit on object level
failed for tx org.apache.ojb.odmg.TransactionImpl@513d387e
java.lang.AbstractMethodError: $ProxyDM0.close
       at 
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl.java:1299)
       at 
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl.java:1261)
       at 
org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(DelegatingPersistenceBroker.java:171)
       at 
org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(DelegatingPersistenceBroker.java:171)
       at 
org.apache.ojb.odmg.states.StateNewDirty.commit(StateNewDirty.java:148)
       at 
org.apache.ojb.odmg.ObjectEnvelopeTable.commitAllEnvelopes(ObjectEnvelopeTable.java:241)
       at 
org.apache.ojb.odmg.ObjectEnvelopeTable.commit(ObjectEnvelopeTable.java:195)
       at 
org.apache.ojb.odmg.TransactionImpl.doCommitOnObjects(TransactionImpl.java:335)
       at 
org.apache.ojb.odmg.TransactionImpl.prepare(TransactionImpl.java:656)
       at 
org.apache.ojb.odmg.TransactionImpl.commit(TransactionImpl.java:613)

Thanks,

Rouven



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Problems using Batch Mode with JDK 1.2 (Bug?)

Posted by Rouven Oberholzer <ro...@2think4u.com>.
Hi Oleg,

Thank you very much for that fix. Now it works.

Regards,
Rouven


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Problems using Batch Mode with JDK 1.2 (Bug?)

Posted by Oleg Nitz <on...@ukr.net>.
Hi Rouven,

The problem is in proxy.jar, that Proxy implementation doesn't provide methods 
from superclasses of given interfaces. But the workaround is simple and 
I have committed it to CVS. You can get BatchConnection.java from CVS HEAD 
(for example, via web CVS interface) and put it to your rc5 source tree.

Regards,
 Oleg

On Friday 12 March 2004 08:21, Rouven Oberholzer wrote:
> Hi Oleg,
>
> I'am using the packaged rc5 src zip file available at db.apache.org/ojb.
>
> I'am a little confused about that line numbers in java. the stack trace
> posted was out of the eclipse debugger. now i rerun the test without
> debugger and I'am getting correct line numbers. I also tryed disable and
> enable the jit to run this test. when I disable the jit I'am getting the
> same error before (AbstractMethodError) when I enable the jit I'am
> getting a NullPointerException at the same place, see stack traces.
>
> JIT DISABLED:
> java.lang.AbstractMethodError: $ProxyDM0.close
>        at
> org.apache.ojb.broker.accesslayer.StatementManager.closeResources(Statement
>Manager.java:15 7)
>        at
> org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeInsert(JdbcAccessIm
>pl.java:270) at
> org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(PersistenceBroke
>rImpl.java:1384 )
>        at
> org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImp
>l.java:1301) at
> org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImp
>l.java:1261) at
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(DelegatingPers
>istenceBroker.j ava:171)
>        at
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(DelegatingPers
>istenceBroker.j ava:171)
>        at
> org.apache.ojb.odmg.states.StateNewDirty.commit(StateNewDirty.java:148)
>        at
> org.apache.ojb.odmg.ObjectEnvelopeTable.commitAllEnvelopes(ObjectEnvelopeTa
>ble.java:241) at
> org.apache.ojb.odmg.ObjectEnvelopeTable.commit(ObjectEnvelopeTable.java:195
>) at
> org.apache.ojb.odmg.TransactionImpl.doCommitOnObjects(TransactionImpl.java:
>335) at
> org.apache.ojb.odmg.TransactionImpl.prepare(TransactionImpl.java:656)
>        at
> org.apache.ojb.odmg.TransactionImpl.commit(TransactionImpl.java:613)
>
> JIT ENABLED:
> 9135    ERROR [main] ObjectEnvelopeTable.commit: Commit on object level
> failed for tx org.apache.ojb.odmg.TransactionImpl@eda02098
> java.lang.NullPointerException
>        at
> org.apache.ojb.broker.accesslayer.StatementManager.closeResources(Statement
>Manager.java, Compiled Code)
>        at
> org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeInsert(JdbcAccessIm
>pl.java:270) at
> org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(PersistenceBroke
>rImpl.java:1384 )
>        at
> org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImp
>l.java:1301) at
> org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImp
>l.java:1261) at
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(DelegatingPers
>istenceBroker.j ava:171)
>        at
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(DelegatingPers
>istenceBroker.j ava:171)
>        at
> org.apache.ojb.odmg.states.StateNewDirty.commit(StateNewDirty.java:148)
>        at
> org.apache.ojb.odmg.ObjectEnvelopeTable.commitAllEnvelopes(ObjectEnvelopeTa
>ble.java, Compiled Code)
>        at
> org.apache.ojb.odmg.ObjectEnvelopeTable.commit(ObjectEnvelopeTable.java:195
>) at
> org.apache.ojb.odmg.TransactionImpl.doCommitOnObjects(TransactionImpl.java,
> Compiled Code)
>        at
> org.apache.ojb.odmg.TransactionImpl.prepare(TransactionImpl.java:656)
>        at
> org.apache.ojb.odmg.TransactionImpl.commit(TransactionImpl.java:613)
>
>
> Rouven
>
> Oleg Nitz wrote:
> > Hi Rouven,
> >
> > My idea was wrong, PersistenceBrokerImpl.java doesn't have conditional
> > compilation directives, so line numbers in the stack trace should match
> > the source file.
> > Please, look at your file PersistenceBrokerImpl.java and tell me what is
> > in the line 1299 and around. JDK shouldn't show wrong line numbers,
> > whatever version of JDK you use.
> > Are you using OJB from rc5 src tarball, or have you checked it out from
> > CVS yourself?
> >
> > Oleg
> >
> > On Thursday 11 March 2004 12:22, Rouven Oberholzer wrote:
> >>Hi Oleg and all,
> >>
> >>Thanks for your response.
> >>You're right I over looked that about the line number in the stack trace.
> >>so I retried the compilation to be sure having the right version in the
> >>classpath. which gave me the same result. so i switched to jdk 1.2.2_017
> >> to be sure having the newest 1.2 jdk available -> same result. yes I use
> >> the sun jdk.
> >>
> >>I'am not sure if the problem could be related to the proxy.jar I'am
> >> using. I took that one available in the sourceforge ojb project from
> >> release rc1. like recommended in the build.xml. I couldn't find anything
> >> newer.
> >>
> >>Does anyone else use ojb with sun jdk 1.2 and batch_mode=true, (and has
> >> it running)?
> >>
> >>Thanks,
> >>Rouven
> >>
> >>
> >>---------------------------------------------------------------------
> >>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: Problems using Batch Mode with JDK 1.2 (Bug?)

Posted by Rouven Oberholzer <ro...@2think4u.com>.
Hi Oleg,

I'am using the packaged rc5 src zip file available at db.apache.org/ojb.

I'am a little confused about that line numbers in java. the stack trace
posted was out of the eclipse debugger. now i rerun the test without 
debugger and I'am getting correct line numbers. I also tryed disable and 
enable the jit to run this test. when I disable the jit I'am getting the 
same error before (AbstractMethodError) when I enable the jit I'am 
getting a NullPointerException at the same place, see stack traces.

JIT DISABLED:
java.lang.AbstractMethodError: $ProxyDM0.close
       at
org.apache.ojb.broker.accesslayer.StatementManager.closeResources(StatementManager.java:15
7)
       at
org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeInsert(JdbcAccessImpl.java:270)
       at
org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(PersistenceBrokerImpl.java:1384
)
       at
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl.java:1301)
       at
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl.java:1261)
       at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(DelegatingPersistenceBroker.j
ava:171)
       at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(DelegatingPersistenceBroker.j
ava:171)
       at
org.apache.ojb.odmg.states.StateNewDirty.commit(StateNewDirty.java:148)
       at
org.apache.ojb.odmg.ObjectEnvelopeTable.commitAllEnvelopes(ObjectEnvelopeTable.java:241)
       at
org.apache.ojb.odmg.ObjectEnvelopeTable.commit(ObjectEnvelopeTable.java:195)
       at
org.apache.ojb.odmg.TransactionImpl.doCommitOnObjects(TransactionImpl.java:335)
       at
org.apache.ojb.odmg.TransactionImpl.prepare(TransactionImpl.java:656)
       at
org.apache.ojb.odmg.TransactionImpl.commit(TransactionImpl.java:613)

JIT ENABLED:
9135    ERROR [main] ObjectEnvelopeTable.commit: Commit on object level
failed for tx org.apache.ojb.odmg.TransactionImpl@eda02098
java.lang.NullPointerException
       at
org.apache.ojb.broker.accesslayer.StatementManager.closeResources(StatementManager.java,
  Compiled Code)
       at
org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeInsert(JdbcAccessImpl.java:270)
       at
org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(PersistenceBrokerImpl.java:1384
)
       at
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl.java:1301)
       at
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl.java:1261)
       at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(DelegatingPersistenceBroker.j
ava:171)
       at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(DelegatingPersistenceBroker.j
ava:171)
       at
org.apache.ojb.odmg.states.StateNewDirty.commit(StateNewDirty.java:148)
       at
org.apache.ojb.odmg.ObjectEnvelopeTable.commitAllEnvelopes(ObjectEnvelopeTable.java,
  Compiled Code)
       at
org.apache.ojb.odmg.ObjectEnvelopeTable.commit(ObjectEnvelopeTable.java:195)
       at
org.apache.ojb.odmg.TransactionImpl.doCommitOnObjects(TransactionImpl.java,
Compiled Code)
       at
org.apache.ojb.odmg.TransactionImpl.prepare(TransactionImpl.java:656)
       at
org.apache.ojb.odmg.TransactionImpl.commit(TransactionImpl.java:613)


Rouven

Oleg Nitz wrote:
> Hi Rouven,
> 
> My idea was wrong, PersistenceBrokerImpl.java doesn't have conditional 
> compilation directives, so line numbers in the stack trace should match 
> the source file.
> Please, look at your file PersistenceBrokerImpl.java and tell me what is in 
> the line 1299 and around. JDK shouldn't show wrong line numbers, whatever 
> version of JDK you use. 
> Are you using OJB from rc5 src tarball, or have you checked it out from CVS 
> yourself?
> 
> Oleg
> 
> On Thursday 11 March 2004 12:22, Rouven Oberholzer wrote:
> 
>>Hi Oleg and all,
>>
>>Thanks for your response.
>>You're right I over looked that about the line number in the stack trace.
>>so I retried the compilation to be sure having the right version in the
>>classpath. which gave me the same result. so i switched to jdk 1.2.2_017 to
>>be sure having the newest 1.2 jdk available -> same result. yes I use the
>>sun jdk.
>>
>>I'am not sure if the problem could be related to the proxy.jar I'am using.
>>I took that one available in the sourceforge ojb project from release rc1.
>>like recommended in the build.xml. I couldn't find anything newer.
>>
>>Does anyone else use ojb with sun jdk 1.2 and batch_mode=true, (and has it
>>running)?
>>
>>Thanks,
>>Rouven
>>
>>
>>---------------------------------------------------------------------
>>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: Problems using Batch Mode with JDK 1.2 (Bug?)

Posted by Oleg Nitz <on...@ukr.net>.
Hi Rouven,

My idea was wrong, PersistenceBrokerImpl.java doesn't have conditional 
compilation directives, so line numbers in the stack trace should match 
the source file.
Please, look at your file PersistenceBrokerImpl.java and tell me what is in 
the line 1299 and around. JDK shouldn't show wrong line numbers, whatever 
version of JDK you use. 
Are you using OJB from rc5 src tarball, or have you checked it out from CVS 
yourself?

Oleg

On Thursday 11 March 2004 12:22, Rouven Oberholzer wrote:
> Hi Oleg and all,
>
> Thanks for your response.
> You're right I over looked that about the line number in the stack trace.
> so I retried the compilation to be sure having the right version in the
> classpath. which gave me the same result. so i switched to jdk 1.2.2_017 to
> be sure having the newest 1.2 jdk available -> same result. yes I use the
> sun jdk.
>
> I'am not sure if the problem could be related to the proxy.jar I'am using.
> I took that one available in the sourceforge ojb project from release rc1.
> like recommended in the build.xml. I couldn't find anything newer.
>
> Does anyone else use ojb with sun jdk 1.2 and batch_mode=true, (and has it
> running)?
>
> Thanks,
> Rouven
>
>
> ---------------------------------------------------------------------
> 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: Question about Sequences

Posted by Armin Waibel <ar...@apache.org>.
Hi Christian,

Christian Eugster wrote:

> Maybe someone can help me.
> 
> I run two databases (both mysql) concurrently (one on a server, the other
> locally to ensure, that the program may run, even the server is down). I
> want the records of some tables to be identic on both databases (even their
> primary keys).
> 
> Every table has a Long (BIGINT) id-field as a primary key. I use ojb's
> sequencemanager (HighLowImpl). Has anybody an idea how I have to setup ojb
> that i can insert a record with a given id, i.e. to insert an object in db1
> first and then in db2 with the same primary key?
> 

I'm sure don't understand the problem (aside from the distributed tx 
problem ;-)).
If you store the object with PB_DB1 then pass the object to PB_DB2 the 
PK of the object already exists (was set in object), thus PB_DB2 does 
not create a new one. If you always do DB1--->DB2 insert all will be ok 
(then always OJB_HL_SEQ table of the first DB was used), but if you one 
time do a DB2--->DB1 insert you will run into problems.

Maybe it will be usefull to implement your own SequenceManger class 
generates keys independent from the databases.

regards,
Armin


> Sorry for that thumb question, but I appreciate any help!
> 
> Thanks
> 
> Christian
> 
> 
> ---------------------------------------------------------------------
> 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


Question about Sequences

Posted by Christian Eugster <ch...@bluewin.ch>.
Maybe someone can help me.

I run two databases (both mysql) concurrently (one on a server, the other
locally to ensure, that the program may run, even the server is down). I
want the records of some tables to be identic on both databases (even their
primary keys).

Every table has a Long (BIGINT) id-field as a primary key. I use ojb's
sequencemanager (HighLowImpl). Has anybody an idea how I have to setup ojb
that i can insert a record with a given id, i.e. to insert an object in db1
first and then in db2 with the same primary key?

Sorry for that thumb question, but I appreciate any help!

Thanks

Christian


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Problems using Batch Mode with JDK 1.2 (Bug?)

Posted by Oleg Nitz <on...@ukr.net>.
> You're right I over looked that about the line number in the stack trace. so  
> I retried the compilation to be sure having the right version in the classpath.
> which gave me the same result. so i switched to jdk 1.2.2_017 to be sure having
> the newest 1.2 jdk available -> same result.
Oh, I think I understand why the line number differs: this is due to conditional compilation, probably the source file is modified when compiled for jdk 1.2.2
Okay, I'll investigate this further tonight.


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Problems using Batch Mode with JDK 1.2 (Bug?)

Posted by Rouven Oberholzer <ro...@2think4u.com>.
Hi Oleg and all,

Thanks for your response.
You're right I over looked that about the line number in the stack trace. so I 
retried the compilation to be sure having the right version in the classpath.
which gave me the same result. so i switched to jdk 1.2.2_017 to be sure having
the newest 1.2 jdk available -> same result. yes I use the sun jdk.

I'am not sure if the problem could be related to the proxy.jar I'am using. I
took that one available in the sourceforge ojb project from release rc1. like
recommended in the build.xml. I couldn't find anything newer.

Does anyone else use ojb with sun jdk 1.2 and batch_mode=true, (and has it 
running)?

Thanks,
Rouven


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: Problems using Batch Mode with JDK 1.2 (Bug?)

Posted by Oleg Nitz <on...@ukr.net>.
Hi Rouven and all,

I am a bit disappointed: the line number 1299 in the stack trace don't match 
the OJB_1_0_RC5 tagged source file PersistenceBrokerImpl.java (revision 1.60)
There is a "try" keyword in that line, and nothing about batch mode around. 
Any ideas?
BTW, is it Sun JDK 1.2.2_014?

Regards,
 Oleg

On Monday 08 March 2004 17:40, Rouven Oberholzer wrote:
> Hi all!
>
> I get following error if I try to switch on the batch mode. I compiled
> the source distribution with jdk 1.2. If I do the same with jdk 1.3
> everything works perfect. Unfortunatly i have to use jdk 1.2 at the
> customer side.
>
> My application is storing a new Object to the database. I'am using the
> odmg interface.
>
> Does anyone have an idea whats going wrong?
>
> My environment:
> OJB Version: rc5
> JDK Version: 1.2.2_014
> Database: Oracle 9i
>
> Stacktrace:
> 20219   ERROR [main] ObjectEnvelopeTable.commit: Commit on object level
> failed for tx org.apache.ojb.odmg.TransactionImpl@513d387e
> java.lang.AbstractMethodError: $ProxyDM0.close
>        at
> org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImp
>l.java:1299) at
> org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImp
>l.java:1261) at
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(DelegatingPers
>istenceBroker.java:171) at
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(DelegatingPers
>istenceBroker.java:171) at
> org.apache.ojb.odmg.states.StateNewDirty.commit(StateNewDirty.java:148)
>        at
> org.apache.ojb.odmg.ObjectEnvelopeTable.commitAllEnvelopes(ObjectEnvelopeTa
>ble.java:241) at
> org.apache.ojb.odmg.ObjectEnvelopeTable.commit(ObjectEnvelopeTable.java:195
>) at
> org.apache.ojb.odmg.TransactionImpl.doCommitOnObjects(TransactionImpl.java:
>335) at
> org.apache.ojb.odmg.TransactionImpl.prepare(TransactionImpl.java:656)
>        at
> org.apache.ojb.odmg.TransactionImpl.commit(TransactionImpl.java:613)
>
> Thanks,
>
> Rouven
>
>
>
> ---------------------------------------------------------------------
> 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