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 Stéphane El Guedj <se...@deliasystems.com> on 2003/12/16 13:33:18 UTC

BATCH-MODE problem (repost)

Hi,

I'm currently trying to improve my app performances and I therefore tried to
set the batch-mode property in the repository to "true". Unfortunately,
whenever OJB attempts to submit the batch, I get the following exception:

java.lang.IllegalArgumentException: object is not an instance of declaring
class
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at
org.apache.ojb.broker.util.batch.PreparedStatementInvocationHandler.doExecut
e(Unknown Source)
        at
org.apache.ojb.broker.util.batch.PreparedStatementInvocationHandler.invoke(U
nknown Source)
        at $Proxy0.doExecute(Unknown Source)
        at
org.apache.ojb.broker.util.batch.BatchConnection.executeBatch(Unknown
Source)
        at
org.apache.ojb.broker.util.batch.BatchConnection.nextExecuted(Unknown
Source)
        at
org.apache.ojb.broker.util.batch.PreparedStatementInvocationHandler.invoke(U
nknown Source)
        at $Proxy0.executeUpdate(Unknown Source)
        at
org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeUpdate(Unknown
Source)
        at
org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Unknown
Source)
        at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown
Source)Notif 4240 - act: 4832

        at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown
Source)
        at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
Source)
        at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
Source)
        at Test.main(Test.java:110)


I am using Oracle 8i and OJB 1.0rc4.
Here is an excerpt from my repository:

	<jdbc-connection-descriptor
		default-connection="true"
		jcd-alias="bod"
		platform="oracle"
		jdbc-level="2.0"
		driver="oracle.jdbc.driver.OracleDriver"
		protocol="jdbc"
		subprotocol="oracle:thin"
		dbalias="@superbug:1521:dbmaster"
		username="SEJ"
		password="SEJ"
		batch-mode="true"
	    >
		<connection-pool
		    maxActive="15"
		    whenExhaustedAction="0"
		    testOnBorrow="false"
		    testOnReturn="false"
		    validationQuery="select count(*) from OJB_HL_SEQ"
		/>

		<sequence-manager
className="org.apache.ojb.broker.util.sequence.SequenceManagerInMemoryImpl">
				    <attribute attribute-name="autoNaming"
                                    attribute-value="true"/>
		</sequence-manager>


	</jdbc-connection-descriptor>


Here is a code excerpt:

	broker.beginTransaction();
	broker.serviceConnectionManager().setBatchMode(true);
	broker.store(o);
	broker.commitTransaction();


My question: can I use batch-mode with Oracle, and if so, do I use the right
driver...

Thanks in advance.
Regards
Stiphane El Guedj


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


RE: BATCH-MODE problem (repost)

Posted by Ron Gallagher <ro...@bellsouth.net>.
Oleg/Stephane --

I am pretty certain that this problem is gone in RC5.  Back in July, I
submitted a bug report/patch to document/fix this problem.  Revision 1.7 of
o.a.o.b.util.batch.PreparedStatementInvocationHandler was created on/about
July 29, and it contains this fix.

Ron Gallagher
Atlanta, GA
rongallagher@bellsouth.net

-----Original Message-----
From: Oleg Nitz [mailto:on@ukr.net]
Sent: Tuesday, December 16, 2003 7:59 PM
To: OJB Users List
Subject: Re: BATCH-MODE problem (repost)


Hi Stéphane,

sorry for the delay. Unfortunately, the stack trace doesn't show line
numbers
for OJB classes. Probably this is because the jar for the release is build
without debug info.
Also I would like to know which version do you use.
That would be great if you get RC5 sources, build target jar-debug and
re-run
your app. Actually if you used earlier release, you may find that the
problem
disappears with RC5 ;-)

Oleg

On Tuesday 16 December 2003 12:33, Stéphane El Guedj wrote:
> Hi,
>
> I'm currently trying to improve my app performances and I therefore tried
> to set the batch-mode property in the repository to "true". Unfortunately,
> whenever OJB attempts to submit the batch, I get the following exception:
>
> java.lang.IllegalArgumentException: object is not an instance of declaring
> class
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:3
>9 )
>         at
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp
>l .java:25)
>         at java.lang.reflect.Method.invoke(Method.java:324)
>         at
>
org.apache.ojb.broker.util.batch.PreparedStatementInvocationHandler.doExecu
>t e(Unknown Source)
>         at
>
org.apache.ojb.broker.util.batch.PreparedStatementInvocationHandler.invoke(
>U nknown Source)
>         at $Proxy0.doExecute(Unknown Source)
>         at
> org.apache.ojb.broker.util.batch.BatchConnection.executeBatch(Unknown
> Source)
>         at
> org.apache.ojb.broker.util.batch.BatchConnection.nextExecuted(Unknown
> Source)
>         at
>
org.apache.ojb.broker.util.batch.PreparedStatementInvocationHandler.invoke(
>U nknown Source)
>         at $Proxy0.executeUpdate(Unknown Source)
>         at
> org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeUpdate(Unknown
> Source)
>         at
> org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Unknown
> Source)
>         at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown
> Source)Notif 4240 - act: 4832
>
>         at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown
> Source)
>         at
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
> Source)
>         at
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
> Source)
>         at Test.main(Test.java:110)
>
>
> I am using Oracle 8i and OJB 1.0rc4.
> Here is an excerpt from my repository:
>
> 	<jdbc-connection-descriptor
> 		default-connection="true"
> 		jcd-alias="bod"
> 		platform="oracle"
> 		jdbc-level="2.0"
> 		driver="oracle.jdbc.driver.OracleDriver"
> 		protocol="jdbc"
> 		subprotocol="oracle:thin"
> 		dbalias="@superbug:1521:dbmaster"
> 		username="SEJ"
> 		password="SEJ"
> 		batch-mode="true"
>
> 		<connection-pool
> 		    maxActive="15"
> 		    whenExhaustedAction="0"
> 		    testOnBorrow="false"
> 		    testOnReturn="false"
> 		    validationQuery="select count(*) from OJB_HL_SEQ"
> 		/>
>
> 		<sequence-manager
>
className="org.apache.ojb.broker.util.sequence.SequenceManagerInMemoryImpl"
>> <attribute attribute-name="autoNaming"
>                                     attribute-value="true"/>
> 		</sequence-manager>
>
>
> 	</jdbc-connection-descriptor>
>
>
> Here is a code excerpt:
>
> 	broker.beginTransaction();
> 	broker.serviceConnectionManager().setBatchMode(true);
> 	broker.store(o);
> 	broker.commitTransaction();
>
>
> My question: can I use batch-mode with Oracle, and if so, do I use the
> right driver...
>
> Thanks in advance.
> Regards
> Stiphane El Guedj
>
>
> ---------------------------------------------------------------------
> 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: BATCH-MODE problem (repost)

Posted by Oleg Nitz <on...@ukr.net>.
Hi Stéphane,

sorry for the delay. Unfortunately, the stack trace doesn't show line numbers 
for OJB classes. Probably this is because the jar for the release is build 
without debug info. 
Also I would like to know which version do you use.
That would be great if you get RC5 sources, build target jar-debug and re-run 
your app. Actually if you used earlier release, you may find that the problem 
disappears with RC5 ;-)

Oleg

On Tuesday 16 December 2003 12:33, Stéphane El Guedj wrote:
> Hi,
>
> I'm currently trying to improve my app performances and I therefore tried
> to set the batch-mode property in the repository to "true". Unfortunately,
> whenever OJB attempts to submit the batch, I get the following exception:
>
> java.lang.IllegalArgumentException: object is not an instance of declaring
> class
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:3
>9 )
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp
>l .java:25)
>         at java.lang.reflect.Method.invoke(Method.java:324)
>         at
> org.apache.ojb.broker.util.batch.PreparedStatementInvocationHandler.doExecu
>t e(Unknown Source)
>         at
> org.apache.ojb.broker.util.batch.PreparedStatementInvocationHandler.invoke(
>U nknown Source)
>         at $Proxy0.doExecute(Unknown Source)
>         at
> org.apache.ojb.broker.util.batch.BatchConnection.executeBatch(Unknown
> Source)
>         at
> org.apache.ojb.broker.util.batch.BatchConnection.nextExecuted(Unknown
> Source)
>         at
> org.apache.ojb.broker.util.batch.PreparedStatementInvocationHandler.invoke(
>U nknown Source)
>         at $Proxy0.executeUpdate(Unknown Source)
>         at
> org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeUpdate(Unknown
> Source)
>         at
> org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Unknown
> Source)
>         at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown
> Source)Notif 4240 - act: 4832
>
>         at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown
> Source)
>         at
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
> Source)
>         at
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
> Source)
>         at Test.main(Test.java:110)
>
>
> I am using Oracle 8i and OJB 1.0rc4.
> Here is an excerpt from my repository:
>
> 	<jdbc-connection-descriptor
> 		default-connection="true"
> 		jcd-alias="bod"
> 		platform="oracle"
> 		jdbc-level="2.0"
> 		driver="oracle.jdbc.driver.OracleDriver"
> 		protocol="jdbc"
> 		subprotocol="oracle:thin"
> 		dbalias="@superbug:1521:dbmaster"
> 		username="SEJ"
> 		password="SEJ"
> 		batch-mode="true"
>
> 		<connection-pool
> 		    maxActive="15"
> 		    whenExhaustedAction="0"
> 		    testOnBorrow="false"
> 		    testOnReturn="false"
> 		    validationQuery="select count(*) from OJB_HL_SEQ"
> 		/>
>
> 		<sequence-manager
> className="org.apache.ojb.broker.util.sequence.SequenceManagerInMemoryImpl"
>> <attribute attribute-name="autoNaming"
>                                     attribute-value="true"/>
> 		</sequence-manager>
>
>
> 	</jdbc-connection-descriptor>
>
>
> Here is a code excerpt:
>
> 	broker.beginTransaction();
> 	broker.serviceConnectionManager().setBatchMode(true);
> 	broker.store(o);
> 	broker.commitTransaction();
>
>
> My question: can I use batch-mode with Oracle, and if so, do I use the
> right driver...
>
> Thanks in advance.
> Regards
> Stiphane El Guedj
>
>
> ---------------------------------------------------------------------
> 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