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 mf...@digitalchocolate.com on 2005/11/04 07:12:38 UTC

Incorrect arguments to mysql_stmt_execute

At work I am using OJB with MySQL version 4.1.10a-Max on a Redhat
Enterprise 3 box. Now I am trying to replicate my work environment at home
on my Ubuntu Linux box. The MySQL version at home is
4.1.12-Debian_1ubuntu3, which while not exactly the same as at work does
seem reasonably close. I am running MySQL with the exact same config as at
work (using InnoDB and UTF-8).

It looks like OJB can read from the database just fine, but whenever I try
to update or insert data, it fails with an error message (see below).

I have tried everything I could think of, such as swapping the OJB 1.0.2
JAR we are still using for the latest 1.0.3 JAR (and updating the config
files appropriately), swapping the MySQL connector from 3.1.7 to 3.1.11 (I
even tried the 3.2 alpha), etc. No luck...

I also tried to google the error message "Incorrect arguments to
mysql_stmt_execute", but I wasn't able to turn up anything useful.

Does anybody have any ideas what could be causing this?

-Mirko


    [junit] [EntityPersistence.java:590] Updating entity:
ApplicationEntity[shortName: 'DC Sample', fullName: 'DC Sample',
reportsScores: '1', applicationKey: 'sampleapp', active: 'false',
subscriptionApp: 'false', id: '4', ]
    [junit] [org.apache.ojb.broker.accesslayer.JdbcAccessImpl] ERROR:
SQLException during the execution of the update (for a
com.dchoc.common.entity.ApplicationEntity): Incorrect arguments to
mysql_stmt_execute
    [junit] Incorrect arguments to mysql_stmt_execute
    [junit] java.sql.SQLException: Incorrect arguments to mysql_stmt_execute
    [junit]     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2847)
    [junit]     at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1531)
    [junit]     at
com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1347)
    [junit]     at
com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:958)
    [junit]     at
com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1957)
    [junit]     at
com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1880)
    [junit]     at
com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1741)
    [junit]     at
org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101)
    [junit]     at
org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101)
    [junit]     at
org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeUpdate(Unknown
Source)
    [junit]     at
org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Unknown
Source)
    [junit]     at
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source)
    [junit]     at
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source)
    [junit]     at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
Source)
    [junit]     at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
Source)
    [junit]     at
com.dchoc.common.entity.EntityPersistence.update(EntityPersistence.java:597)
    [junit]     at
com.dchoc.common.entity.EntityPersistence.update(EntityPersistence.java:550)
    [junit]     at
com.dchoc.common.home.AbstractHome.update(AbstractHome.java:66)
    [junit]     at
com.dchoc.common.home.ApplicationHome.update(ApplicationHome.java:251)
    [junit]     at
com.dchoc.common.home.TestApplicationHome.testUpdate(TestApplicationHome.java:72)
    [junit]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
    [junit]     at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    [junit]     at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [junit]     at java.lang.reflect.Method.invoke(Method.java:324)
    [junit]     at junit.framework.TestCase.runTest(TestCase.java:154)
    [junit]     at junit.framework.TestCase.runBare(TestCase.java:127)
    [junit]     at junit.framework.TestResult$1.protect(TestResult.java:106)
    [junit]     at
junit.framework.TestResult.runProtected(TestResult.java:124)
    [junit]     at junit.framework.TestResult.run(TestResult.java:109)
    [junit]     at junit.framework.TestCase.run(TestCase.java:118)
    [junit]     at junit.framework.TestSuite.runTest(TestSuite.java:208)
    [junit]     at junit.framework.TestSuite.run(TestSuite.java:203)
    [junit]     at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:297)
    [junit]     at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:672)
    [junit]     at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:567)


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


Re: Incorrect arguments to mysql_stmt_execute

Posted by Mirko Froehlich <mf...@digitalchocolate.com>.
This workaround did indeed fix my problems as well. Thanks again!

-Mirko


Mirko Froehlich wrote:

> Hi Jakob,
>
> That's great news! Thanks for tracking this down.
>
> I'll give this workaround a shot at home later.
>
> -Mirko
>
>
> Jakob Braeuchi wrote:
>
>> hi mirko,
>>
>> setting the property "useServerPrepStmts" to false
>> solved the problem:
>>
>> ?useServerPrepStmts=false
>>
>>      <jdbc-connection-descriptor
>>            jcd-alias="default"
>>            default-connection="true"
>>            platform="MySQL"
>>            jdbc-level="2.0"
>>            driver="com.p6spy.engine.spy.P6SpyDriver"
>>            protocol="jdbc"
>>            subprotocol="mysql"
>>            dbalias="//localhost:3306/ojb?useServerPrepStmts=false"
>>            username="ojb"
>>            password="ojb"
>>             eager-release="false"
>>            batch-mode="false"
>>             useAutoCommit="1"
>>             ignoreAutoCommitExceptions="false"
>>      >
>>
>> hth
>> jakob
>>
>> Jakob Braeuchi schrieb:
>>
>>> hi mirko,
>>>
>>> this looks like a known problem:
>>>
>>> http://forums.mysql.com/read.php?39,49989,49989#msg-49989
>>> http://www.ubuntuforums.org/showthread.php?t=86294&highlight=mysql_stmt_execute 
>>>
>>>
>>> jakob
>>>
>>> Jakob Braeuchi schrieb:
>>>
>>>> hi mirko,
>>>>
>>>> although i see a correct insert statement and a commit, the row is 
>>>> not in the db ??
>>>>
>>>> 1131129091835|1|1|statement|SELECT 
>>>> A0.TABLENAME,A0.MAX_KEY,A0.GRAB_SIZE,A0.VERSION FROM OJB_HL_SEQ A0 
>>>> WHERE A0.TABLENAME = ?|SELECT 
>>>> A0.TABLENAME,A0.MAX_KEY,A0.GRAB_SIZE,A0.VERSION FROM OJB_HL_SEQ A0 
>>>> WHERE A0.TABLENAME = 'SEQ_PERSON'
>>>> 1131129145745|1|0|statement||SELECT MAX(ID) FROM PERSON
>>>> 1131129177565|1|1|statement|INSERT INTO OJB_HL_SEQ 
>>>> (TABLENAME,MAX_KEY,GRAB_SIZE,VERSION) VALUES (?,?,?,?) |INSERT INTO 
>>>> OJB_HL_SEQ (TABLENAME,MAX_KEY,GRAB_SIZE,VERSION) VALUES 
>>>> ('SEQ_PERSON','200020','20','1')
>>>> 1131129201567|2|1|commit||
>>>>
>>>> jakob
>>>>
>>>> Jakob Braeuchi schrieb:
>>>>
>>>>> hi mirko,
>>>>>
>>>>> i do have the same problem on ubuntu.
>>>>> it looks like if some statements do not return a proper resultset:
>>>>>
>>>>> SELECT A0.TABLENAME,A0.MAX_KEY,A0.GRAB_SIZE,A0.VERSION FROM 
>>>>> OJB_HL_SEQ A0 WHERE A0.TABLENAME = 'SEQ_PERSON'
>>>>>
>>>>> return 0 rows when executed within mysql-query-browser but via 
>>>>> jdbc rs#next() returns true ????
>>>>>
>>>>> jakob
>>>>>
>>>>> mfroehlich@digitalchocolate.com schrieb:
>>>>>
>>>>>> At work I am using OJB with MySQL version 4.1.10a-Max on a Redhat
>>>>>> Enterprise 3 box. Now I am trying to replicate my work 
>>>>>> environment at home
>>>>>> on my Ubuntu Linux box. The MySQL version at home is
>>>>>> 4.1.12-Debian_1ubuntu3, which while not exactly the same as at 
>>>>>> work does
>>>>>> seem reasonably close. I am running MySQL with the exact same 
>>>>>> config as at
>>>>>> work (using InnoDB and UTF-8).
>>>>>>
>>>>>> It looks like OJB can read from the database just fine, but 
>>>>>> whenever I try
>>>>>> to update or insert data, it fails with an error message (see 
>>>>>> below).
>>>>>>
>>>>>> I have tried everything I could think of, such as swapping the 
>>>>>> OJB 1.0.2
>>>>>> JAR we are still using for the latest 1.0.3 JAR (and updating the 
>>>>>> config
>>>>>> files appropriately), swapping the MySQL connector from 3.1.7 to 
>>>>>> 3.1.11 (I
>>>>>> even tried the 3.2 alpha), etc. No luck...
>>>>>>
>>>>>> I also tried to google the error message "Incorrect arguments to
>>>>>> mysql_stmt_execute", but I wasn't able to turn up anything useful.
>>>>>>
>>>>>> Does anybody have any ideas what could be causing this?
>>>>>>
>>>>>> -Mirko
>>>>>>
>>>>>>
>>>>>>     [junit] [EntityPersistence.java:590] Updating entity:
>>>>>> ApplicationEntity[shortName: 'DC Sample', fullName: 'DC Sample',
>>>>>> reportsScores: '1', applicationKey: 'sampleapp', active: 'false',
>>>>>> subscriptionApp: 'false', id: '4', ]
>>>>>>     [junit] [org.apache.ojb.broker.accesslayer.JdbcAccessImpl] 
>>>>>> ERROR:
>>>>>> SQLException during the execution of the update (for a
>>>>>> com.dchoc.common.entity.ApplicationEntity): Incorrect arguments to
>>>>>> mysql_stmt_execute
>>>>>>     [junit] Incorrect arguments to mysql_stmt_execute
>>>>>>     [junit] java.sql.SQLException: Incorrect arguments to 
>>>>>> mysql_stmt_execute
>>>>>>     [junit]     at 
>>>>>> com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2847)
>>>>>>     [junit]     at 
>>>>>> com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1531)
>>>>>>     [junit]     at
>>>>>> com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1347) 
>>>>>>
>>>>>>     [junit]     at
>>>>>> com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:958) 
>>>>>>
>>>>>>     [junit]     at
>>>>>> com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1957) 
>>>>>>
>>>>>>     [junit]     at
>>>>>> com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1880) 
>>>>>>
>>>>>>     [junit]     at
>>>>>> com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1741) 
>>>>>>
>>>>>>     [junit]     at
>>>>>> org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101) 
>>>>>>
>>>>>>     [junit]     at
>>>>>> org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101) 
>>>>>>
>>>>>>     [junit]     at
>>>>>> org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeUpdate(Unknown 
>>>>>>
>>>>>> Source)
>>>>>>     [junit]     at
>>>>>> org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Unknown
>>>>>> Source)
>>>>>>     [junit]     at
>>>>>> org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown 
>>>>>> Source)
>>>>>>     [junit]     at
>>>>>> org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown 
>>>>>> Source)
>>>>>>     [junit]     at
>>>>>> org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
>>>>>> Source)
>>>>>>     [junit]     at
>>>>>> org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
>>>>>> Source)
>>>>>>     [junit]     at
>>>>>> com.dchoc.common.entity.EntityPersistence.update(EntityPersistence.java:597) 
>>>>>>
>>>>>>     [junit]     at
>>>>>> com.dchoc.common.entity.EntityPersistence.update(EntityPersistence.java:550) 
>>>>>>
>>>>>>     [junit]     at
>>>>>> com.dchoc.common.home.AbstractHome.update(AbstractHome.java:66)
>>>>>>     [junit]     at
>>>>>> com.dchoc.common.home.ApplicationHome.update(ApplicationHome.java:251) 
>>>>>>
>>>>>>     [junit]     at
>>>>>> com.dchoc.common.home.TestApplicationHome.testUpdate(TestApplicationHome.java:72) 
>>>>>>
>>>>>>     [junit]     at 
>>>>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>>>>> Method)
>>>>>>     [junit]     at
>>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
>>>>>>
>>>>>>     [junit]     at
>>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
>>>>>>
>>>>>>     [junit]     at java.lang.reflect.Method.invoke(Method.java:324)
>>>>>>     [junit]     at 
>>>>>> junit.framework.TestCase.runTest(TestCase.java:154)
>>>>>>     [junit]     at 
>>>>>> junit.framework.TestCase.runBare(TestCase.java:127)
>>>>>>     [junit]     at 
>>>>>> junit.framework.TestResult$1.protect(TestResult.java:106)
>>>>>>     [junit]     at
>>>>>> junit.framework.TestResult.runProtected(TestResult.java:124)
>>>>>>     [junit]     at 
>>>>>> junit.framework.TestResult.run(TestResult.java:109)
>>>>>>     [junit]     at junit.framework.TestCase.run(TestCase.java:118)
>>>>>>     [junit]     at 
>>>>>> junit.framework.TestSuite.runTest(TestSuite.java:208)
>>>>>>     [junit]     at junit.framework.TestSuite.run(TestSuite.java:203)
>>>>>>     [junit]     at
>>>>>> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:297) 
>>>>>>
>>>>>>     [junit]     at
>>>>>> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:672) 
>>>>>>
>>>>>>     [junit]     at
>>>>>> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:567) 
>>>>>>
>>>>>>
>>>>>>
>>>>>> --------------------------------------------------------------------- 
>>>>>>
>>>>>> 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
>>
>

-- 
Mirko Froehlich
Principal Software Engineer

Digital Chocolate - Seize the Minute
1855 South Grant Street, 2nd Floor, San Mateo, CA 94402
Mobile +1 415 860 8456 | Direct +1 650 228 5828 | Fax +1 650 345 1627
mfroehlich@digitalchocolate.com | www.digitalchocolate.com


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


Re: Incorrect arguments to mysql_stmt_execute

Posted by Mirko Froehlich <mf...@digitalchocolate.com>.
Hi Jakob,

That's great news! Thanks for tracking this down.

I'll give this workaround a shot at home later.

-Mirko


Jakob Braeuchi wrote:

> hi mirko,
>
> setting the property "useServerPrepStmts" to false
> solved the problem:
>
> ?useServerPrepStmts=false
>
>      <jdbc-connection-descriptor
>            jcd-alias="default"
>            default-connection="true"
>            platform="MySQL"
>            jdbc-level="2.0"
>            driver="com.p6spy.engine.spy.P6SpyDriver"
>            protocol="jdbc"
>            subprotocol="mysql"
>            dbalias="//localhost:3306/ojb?useServerPrepStmts=false"
>            username="ojb"
>            password="ojb"
>             eager-release="false"
>            batch-mode="false"
>             useAutoCommit="1"
>             ignoreAutoCommitExceptions="false"
>      >
>
> hth
> jakob
>
> Jakob Braeuchi schrieb:
>
>> hi mirko,
>>
>> this looks like a known problem:
>>
>> http://forums.mysql.com/read.php?39,49989,49989#msg-49989
>> http://www.ubuntuforums.org/showthread.php?t=86294&highlight=mysql_stmt_execute 
>>
>>
>> jakob
>>
>> Jakob Braeuchi schrieb:
>>
>>> hi mirko,
>>>
>>> although i see a correct insert statement and a commit, the row is 
>>> not in the db ??
>>>
>>> 1131129091835|1|1|statement|SELECT 
>>> A0.TABLENAME,A0.MAX_KEY,A0.GRAB_SIZE,A0.VERSION FROM OJB_HL_SEQ A0 
>>> WHERE A0.TABLENAME = ?|SELECT 
>>> A0.TABLENAME,A0.MAX_KEY,A0.GRAB_SIZE,A0.VERSION FROM OJB_HL_SEQ A0 
>>> WHERE A0.TABLENAME = 'SEQ_PERSON'
>>> 1131129145745|1|0|statement||SELECT MAX(ID) FROM PERSON
>>> 1131129177565|1|1|statement|INSERT INTO OJB_HL_SEQ 
>>> (TABLENAME,MAX_KEY,GRAB_SIZE,VERSION) VALUES (?,?,?,?) |INSERT INTO 
>>> OJB_HL_SEQ (TABLENAME,MAX_KEY,GRAB_SIZE,VERSION) VALUES 
>>> ('SEQ_PERSON','200020','20','1')
>>> 1131129201567|2|1|commit||
>>>
>>> jakob
>>>
>>> Jakob Braeuchi schrieb:
>>>
>>>> hi mirko,
>>>>
>>>> i do have the same problem on ubuntu.
>>>> it looks like if some statements do not return a proper resultset:
>>>>
>>>> SELECT A0.TABLENAME,A0.MAX_KEY,A0.GRAB_SIZE,A0.VERSION FROM 
>>>> OJB_HL_SEQ A0 WHERE A0.TABLENAME = 'SEQ_PERSON'
>>>>
>>>> return 0 rows when executed within mysql-query-browser but via jdbc 
>>>> rs#next() returns true ????
>>>>
>>>> jakob
>>>>
>>>> mfroehlich@digitalchocolate.com schrieb:
>>>>
>>>>> At work I am using OJB with MySQL version 4.1.10a-Max on a Redhat
>>>>> Enterprise 3 box. Now I am trying to replicate my work environment 
>>>>> at home
>>>>> on my Ubuntu Linux box. The MySQL version at home is
>>>>> 4.1.12-Debian_1ubuntu3, which while not exactly the same as at 
>>>>> work does
>>>>> seem reasonably close. I am running MySQL with the exact same 
>>>>> config as at
>>>>> work (using InnoDB and UTF-8).
>>>>>
>>>>> It looks like OJB can read from the database just fine, but 
>>>>> whenever I try
>>>>> to update or insert data, it fails with an error message (see below).
>>>>>
>>>>> I have tried everything I could think of, such as swapping the OJB 
>>>>> 1.0.2
>>>>> JAR we are still using for the latest 1.0.3 JAR (and updating the 
>>>>> config
>>>>> files appropriately), swapping the MySQL connector from 3.1.7 to 
>>>>> 3.1.11 (I
>>>>> even tried the 3.2 alpha), etc. No luck...
>>>>>
>>>>> I also tried to google the error message "Incorrect arguments to
>>>>> mysql_stmt_execute", but I wasn't able to turn up anything useful.
>>>>>
>>>>> Does anybody have any ideas what could be causing this?
>>>>>
>>>>> -Mirko
>>>>>
>>>>>
>>>>>     [junit] [EntityPersistence.java:590] Updating entity:
>>>>> ApplicationEntity[shortName: 'DC Sample', fullName: 'DC Sample',
>>>>> reportsScores: '1', applicationKey: 'sampleapp', active: 'false',
>>>>> subscriptionApp: 'false', id: '4', ]
>>>>>     [junit] [org.apache.ojb.broker.accesslayer.JdbcAccessImpl] ERROR:
>>>>> SQLException during the execution of the update (for a
>>>>> com.dchoc.common.entity.ApplicationEntity): Incorrect arguments to
>>>>> mysql_stmt_execute
>>>>>     [junit] Incorrect arguments to mysql_stmt_execute
>>>>>     [junit] java.sql.SQLException: Incorrect arguments to 
>>>>> mysql_stmt_execute
>>>>>     [junit]     at 
>>>>> com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2847)
>>>>>     [junit]     at 
>>>>> com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1531)
>>>>>     [junit]     at
>>>>> com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1347) 
>>>>>
>>>>>     [junit]     at
>>>>> com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:958) 
>>>>>
>>>>>     [junit]     at
>>>>> com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1957) 
>>>>>
>>>>>     [junit]     at
>>>>> com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1880) 
>>>>>
>>>>>     [junit]     at
>>>>> com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1741) 
>>>>>
>>>>>     [junit]     at
>>>>> org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101) 
>>>>>
>>>>>     [junit]     at
>>>>> org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101) 
>>>>>
>>>>>     [junit]     at
>>>>> org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeUpdate(Unknown 
>>>>>
>>>>> Source)
>>>>>     [junit]     at
>>>>> org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Unknown
>>>>> Source)
>>>>>     [junit]     at
>>>>> org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown 
>>>>> Source)
>>>>>     [junit]     at
>>>>> org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown 
>>>>> Source)
>>>>>     [junit]     at
>>>>> org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
>>>>> Source)
>>>>>     [junit]     at
>>>>> org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
>>>>> Source)
>>>>>     [junit]     at
>>>>> com.dchoc.common.entity.EntityPersistence.update(EntityPersistence.java:597) 
>>>>>
>>>>>     [junit]     at
>>>>> com.dchoc.common.entity.EntityPersistence.update(EntityPersistence.java:550) 
>>>>>
>>>>>     [junit]     at
>>>>> com.dchoc.common.home.AbstractHome.update(AbstractHome.java:66)
>>>>>     [junit]     at
>>>>> com.dchoc.common.home.ApplicationHome.update(ApplicationHome.java:251) 
>>>>>
>>>>>     [junit]     at
>>>>> com.dchoc.common.home.TestApplicationHome.testUpdate(TestApplicationHome.java:72) 
>>>>>
>>>>>     [junit]     at 
>>>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>>>> Method)
>>>>>     [junit]     at
>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
>>>>>
>>>>>     [junit]     at
>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
>>>>>
>>>>>     [junit]     at java.lang.reflect.Method.invoke(Method.java:324)
>>>>>     [junit]     at 
>>>>> junit.framework.TestCase.runTest(TestCase.java:154)
>>>>>     [junit]     at 
>>>>> junit.framework.TestCase.runBare(TestCase.java:127)
>>>>>     [junit]     at 
>>>>> junit.framework.TestResult$1.protect(TestResult.java:106)
>>>>>     [junit]     at
>>>>> junit.framework.TestResult.runProtected(TestResult.java:124)
>>>>>     [junit]     at 
>>>>> junit.framework.TestResult.run(TestResult.java:109)
>>>>>     [junit]     at junit.framework.TestCase.run(TestCase.java:118)
>>>>>     [junit]     at 
>>>>> junit.framework.TestSuite.runTest(TestSuite.java:208)
>>>>>     [junit]     at junit.framework.TestSuite.run(TestSuite.java:203)
>>>>>     [junit]     at
>>>>> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:297) 
>>>>>
>>>>>     [junit]     at
>>>>> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:672) 
>>>>>
>>>>>     [junit]     at
>>>>> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:567) 
>>>>>
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> 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
>

-- 

Mirko Froehlich
Principal Software Engineer

Digital Chocolate - Seize the Minute
1855 South Grant Street, 2nd Floor, San Mateo, CA 94402
Mobile +1 415 860 8456 | Direct +1 650 228 5828 | Fax +1 650 345 1627
mfroehlich@digitalchocolate.com | www.digitalchocolate.com


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


Re: Incorrect arguments to mysql_stmt_execute

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

setting the property "useServerPrepStmts" to false
solved the problem:

?useServerPrepStmts=false

      <jdbc-connection-descriptor
    		jcd-alias="default"
    		default-connection="true"
    		platform="MySQL"
    		jdbc-level="2.0"
    		driver="com.p6spy.engine.spy.P6SpyDriver"
    		protocol="jdbc"
    		subprotocol="mysql"
    		dbalias="//localhost:3306/ojb?useServerPrepStmts=false"
    		username="ojb"
    		password="ojb"
         	eager-release="false"
    		batch-mode="false"
         	useAutoCommit="1"
         	ignoreAutoCommitExceptions="false"
      >

hth
jakob

Jakob Braeuchi schrieb:
> hi mirko,
> 
> this looks like a known problem:
> 
> http://forums.mysql.com/read.php?39,49989,49989#msg-49989
> http://www.ubuntuforums.org/showthread.php?t=86294&highlight=mysql_stmt_execute 
> 
> 
> jakob
> 
> Jakob Braeuchi schrieb:
> 
>> hi mirko,
>>
>> although i see a correct insert statement and a commit, the row is not 
>> in the db ??
>>
>> 1131129091835|1|1|statement|SELECT 
>> A0.TABLENAME,A0.MAX_KEY,A0.GRAB_SIZE,A0.VERSION FROM OJB_HL_SEQ A0 
>> WHERE A0.TABLENAME = ?|SELECT 
>> A0.TABLENAME,A0.MAX_KEY,A0.GRAB_SIZE,A0.VERSION FROM OJB_HL_SEQ A0 
>> WHERE A0.TABLENAME = 'SEQ_PERSON'
>> 1131129145745|1|0|statement||SELECT MAX(ID) FROM PERSON
>> 1131129177565|1|1|statement|INSERT INTO OJB_HL_SEQ 
>> (TABLENAME,MAX_KEY,GRAB_SIZE,VERSION) VALUES (?,?,?,?) |INSERT INTO 
>> OJB_HL_SEQ (TABLENAME,MAX_KEY,GRAB_SIZE,VERSION) VALUES 
>> ('SEQ_PERSON','200020','20','1')
>> 1131129201567|2|1|commit||
>>
>> jakob
>>
>> Jakob Braeuchi schrieb:
>>
>>> hi mirko,
>>>
>>> i do have the same problem on ubuntu.
>>> it looks like if some statements do not return a proper resultset:
>>>
>>> SELECT A0.TABLENAME,A0.MAX_KEY,A0.GRAB_SIZE,A0.VERSION FROM 
>>> OJB_HL_SEQ A0 WHERE A0.TABLENAME = 'SEQ_PERSON'
>>>
>>> return 0 rows when executed within mysql-query-browser but via jdbc 
>>> rs#next() returns true ????
>>>
>>> jakob
>>>
>>> mfroehlich@digitalchocolate.com schrieb:
>>>
>>>> At work I am using OJB with MySQL version 4.1.10a-Max on a Redhat
>>>> Enterprise 3 box. Now I am trying to replicate my work environment 
>>>> at home
>>>> on my Ubuntu Linux box. The MySQL version at home is
>>>> 4.1.12-Debian_1ubuntu3, which while not exactly the same as at work 
>>>> does
>>>> seem reasonably close. I am running MySQL with the exact same config 
>>>> as at
>>>> work (using InnoDB and UTF-8).
>>>>
>>>> It looks like OJB can read from the database just fine, but whenever 
>>>> I try
>>>> to update or insert data, it fails with an error message (see below).
>>>>
>>>> I have tried everything I could think of, such as swapping the OJB 
>>>> 1.0.2
>>>> JAR we are still using for the latest 1.0.3 JAR (and updating the 
>>>> config
>>>> files appropriately), swapping the MySQL connector from 3.1.7 to 
>>>> 3.1.11 (I
>>>> even tried the 3.2 alpha), etc. No luck...
>>>>
>>>> I also tried to google the error message "Incorrect arguments to
>>>> mysql_stmt_execute", but I wasn't able to turn up anything useful.
>>>>
>>>> Does anybody have any ideas what could be causing this?
>>>>
>>>> -Mirko
>>>>
>>>>
>>>>     [junit] [EntityPersistence.java:590] Updating entity:
>>>> ApplicationEntity[shortName: 'DC Sample', fullName: 'DC Sample',
>>>> reportsScores: '1', applicationKey: 'sampleapp', active: 'false',
>>>> subscriptionApp: 'false', id: '4', ]
>>>>     [junit] [org.apache.ojb.broker.accesslayer.JdbcAccessImpl] ERROR:
>>>> SQLException during the execution of the update (for a
>>>> com.dchoc.common.entity.ApplicationEntity): Incorrect arguments to
>>>> mysql_stmt_execute
>>>>     [junit] Incorrect arguments to mysql_stmt_execute
>>>>     [junit] java.sql.SQLException: Incorrect arguments to 
>>>> mysql_stmt_execute
>>>>     [junit]     at 
>>>> com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2847)
>>>>     [junit]     at 
>>>> com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1531)
>>>>     [junit]     at
>>>> com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1347) 
>>>>
>>>>     [junit]     at
>>>> com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:958) 
>>>>
>>>>     [junit]     at
>>>> com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1957) 
>>>>
>>>>     [junit]     at
>>>> com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1880) 
>>>>
>>>>     [junit]     at
>>>> com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1741) 
>>>>
>>>>     [junit]     at
>>>> org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101) 
>>>>
>>>>     [junit]     at
>>>> org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101) 
>>>>
>>>>     [junit]     at
>>>> org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeUpdate(Unknown
>>>> Source)
>>>>     [junit]     at
>>>> org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Unknown
>>>> Source)
>>>>     [junit]     at
>>>> org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source)
>>>>     [junit]     at
>>>> org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source)
>>>>     [junit]     at
>>>> org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
>>>> Source)
>>>>     [junit]     at
>>>> org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
>>>> Source)
>>>>     [junit]     at
>>>> com.dchoc.common.entity.EntityPersistence.update(EntityPersistence.java:597) 
>>>>
>>>>     [junit]     at
>>>> com.dchoc.common.entity.EntityPersistence.update(EntityPersistence.java:550) 
>>>>
>>>>     [junit]     at
>>>> com.dchoc.common.home.AbstractHome.update(AbstractHome.java:66)
>>>>     [junit]     at
>>>> com.dchoc.common.home.ApplicationHome.update(ApplicationHome.java:251)
>>>>     [junit]     at
>>>> com.dchoc.common.home.TestApplicationHome.testUpdate(TestApplicationHome.java:72) 
>>>>
>>>>     [junit]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>>> Method)
>>>>     [junit]     at
>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
>>>>
>>>>     [junit]     at
>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
>>>>
>>>>     [junit]     at java.lang.reflect.Method.invoke(Method.java:324)
>>>>     [junit]     at junit.framework.TestCase.runTest(TestCase.java:154)
>>>>     [junit]     at junit.framework.TestCase.runBare(TestCase.java:127)
>>>>     [junit]     at 
>>>> junit.framework.TestResult$1.protect(TestResult.java:106)
>>>>     [junit]     at
>>>> junit.framework.TestResult.runProtected(TestResult.java:124)
>>>>     [junit]     at junit.framework.TestResult.run(TestResult.java:109)
>>>>     [junit]     at junit.framework.TestCase.run(TestCase.java:118)
>>>>     [junit]     at 
>>>> junit.framework.TestSuite.runTest(TestSuite.java:208)
>>>>     [junit]     at junit.framework.TestSuite.run(TestSuite.java:203)
>>>>     [junit]     at
>>>> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:297) 
>>>>
>>>>     [junit]     at
>>>> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:672) 
>>>>
>>>>     [junit]     at
>>>> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:567) 
>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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: Incorrect arguments to mysql_stmt_execute

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

this looks like a known problem:

http://forums.mysql.com/read.php?39,49989,49989#msg-49989
http://www.ubuntuforums.org/showthread.php?t=86294&highlight=mysql_stmt_execute

jakob

Jakob Braeuchi schrieb:
> hi mirko,
> 
> although i see a correct insert statement and a commit, the row is not 
> in the db ??
> 
> 1131129091835|1|1|statement|SELECT 
> A0.TABLENAME,A0.MAX_KEY,A0.GRAB_SIZE,A0.VERSION FROM OJB_HL_SEQ A0 WHERE 
> A0.TABLENAME = ?|SELECT A0.TABLENAME,A0.MAX_KEY,A0.GRAB_SIZE,A0.VERSION 
> FROM OJB_HL_SEQ A0 WHERE A0.TABLENAME = 'SEQ_PERSON'
> 1131129145745|1|0|statement||SELECT MAX(ID) FROM PERSON
> 1131129177565|1|1|statement|INSERT INTO OJB_HL_SEQ 
> (TABLENAME,MAX_KEY,GRAB_SIZE,VERSION) VALUES (?,?,?,?) |INSERT INTO 
> OJB_HL_SEQ (TABLENAME,MAX_KEY,GRAB_SIZE,VERSION) VALUES 
> ('SEQ_PERSON','200020','20','1')
> 1131129201567|2|1|commit||
> 
> jakob
> 
> Jakob Braeuchi schrieb:
> 
>> hi mirko,
>>
>> i do have the same problem on ubuntu.
>> it looks like if some statements do not return a proper resultset:
>>
>> SELECT A0.TABLENAME,A0.MAX_KEY,A0.GRAB_SIZE,A0.VERSION FROM OJB_HL_SEQ 
>> A0 WHERE A0.TABLENAME = 'SEQ_PERSON'
>>
>> return 0 rows when executed within mysql-query-browser but via jdbc 
>> rs#next() returns true ????
>>
>> jakob
>>
>> mfroehlich@digitalchocolate.com schrieb:
>>
>>> At work I am using OJB with MySQL version 4.1.10a-Max on a Redhat
>>> Enterprise 3 box. Now I am trying to replicate my work environment at 
>>> home
>>> on my Ubuntu Linux box. The MySQL version at home is
>>> 4.1.12-Debian_1ubuntu3, which while not exactly the same as at work does
>>> seem reasonably close. I am running MySQL with the exact same config 
>>> as at
>>> work (using InnoDB and UTF-8).
>>>
>>> It looks like OJB can read from the database just fine, but whenever 
>>> I try
>>> to update or insert data, it fails with an error message (see below).
>>>
>>> I have tried everything I could think of, such as swapping the OJB 1.0.2
>>> JAR we are still using for the latest 1.0.3 JAR (and updating the config
>>> files appropriately), swapping the MySQL connector from 3.1.7 to 
>>> 3.1.11 (I
>>> even tried the 3.2 alpha), etc. No luck...
>>>
>>> I also tried to google the error message "Incorrect arguments to
>>> mysql_stmt_execute", but I wasn't able to turn up anything useful.
>>>
>>> Does anybody have any ideas what could be causing this?
>>>
>>> -Mirko
>>>
>>>
>>>     [junit] [EntityPersistence.java:590] Updating entity:
>>> ApplicationEntity[shortName: 'DC Sample', fullName: 'DC Sample',
>>> reportsScores: '1', applicationKey: 'sampleapp', active: 'false',
>>> subscriptionApp: 'false', id: '4', ]
>>>     [junit] [org.apache.ojb.broker.accesslayer.JdbcAccessImpl] ERROR:
>>> SQLException during the execution of the update (for a
>>> com.dchoc.common.entity.ApplicationEntity): Incorrect arguments to
>>> mysql_stmt_execute
>>>     [junit] Incorrect arguments to mysql_stmt_execute
>>>     [junit] java.sql.SQLException: Incorrect arguments to 
>>> mysql_stmt_execute
>>>     [junit]     at 
>>> com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2847)
>>>     [junit]     at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1531)
>>>     [junit]     at
>>> com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1347) 
>>>
>>>     [junit]     at
>>> com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:958) 
>>>
>>>     [junit]     at
>>> com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1957) 
>>>
>>>     [junit]     at
>>> com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1880) 
>>>
>>>     [junit]     at
>>> com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1741) 
>>>
>>>     [junit]     at
>>> org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101) 
>>>
>>>     [junit]     at
>>> org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101) 
>>>
>>>     [junit]     at
>>> org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeUpdate(Unknown
>>> Source)
>>>     [junit]     at
>>> org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Unknown
>>> Source)
>>>     [junit]     at
>>> org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source)
>>>     [junit]     at
>>> org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source)
>>>     [junit]     at
>>> org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
>>> Source)
>>>     [junit]     at
>>> org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
>>> Source)
>>>     [junit]     at
>>> com.dchoc.common.entity.EntityPersistence.update(EntityPersistence.java:597) 
>>>
>>>     [junit]     at
>>> com.dchoc.common.entity.EntityPersistence.update(EntityPersistence.java:550) 
>>>
>>>     [junit]     at
>>> com.dchoc.common.home.AbstractHome.update(AbstractHome.java:66)
>>>     [junit]     at
>>> com.dchoc.common.home.ApplicationHome.update(ApplicationHome.java:251)
>>>     [junit]     at
>>> com.dchoc.common.home.TestApplicationHome.testUpdate(TestApplicationHome.java:72) 
>>>
>>>     [junit]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>> Method)
>>>     [junit]     at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
>>>
>>>     [junit]     at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
>>>
>>>     [junit]     at java.lang.reflect.Method.invoke(Method.java:324)
>>>     [junit]     at junit.framework.TestCase.runTest(TestCase.java:154)
>>>     [junit]     at junit.framework.TestCase.runBare(TestCase.java:127)
>>>     [junit]     at 
>>> junit.framework.TestResult$1.protect(TestResult.java:106)
>>>     [junit]     at
>>> junit.framework.TestResult.runProtected(TestResult.java:124)
>>>     [junit]     at junit.framework.TestResult.run(TestResult.java:109)
>>>     [junit]     at junit.framework.TestCase.run(TestCase.java:118)
>>>     [junit]     at junit.framework.TestSuite.runTest(TestSuite.java:208)
>>>     [junit]     at junit.framework.TestSuite.run(TestSuite.java:203)
>>>     [junit]     at
>>> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:297) 
>>>
>>>     [junit]     at
>>> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:672) 
>>>
>>>     [junit]     at
>>> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:567) 
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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: Incorrect arguments to mysql_stmt_execute

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

although i see a correct insert statement and a commit, the row is not 
in the db ??

1131129091835|1|1|statement|SELECT 
A0.TABLENAME,A0.MAX_KEY,A0.GRAB_SIZE,A0.VERSION FROM OJB_HL_SEQ A0 WHERE 
A0.TABLENAME = ?|SELECT A0.TABLENAME,A0.MAX_KEY,A0.GRAB_SIZE,A0.VERSION 
FROM OJB_HL_SEQ A0 WHERE A0.TABLENAME = 'SEQ_PERSON'
1131129145745|1|0|statement||SELECT MAX(ID) FROM PERSON
1131129177565|1|1|statement|INSERT INTO OJB_HL_SEQ 
(TABLENAME,MAX_KEY,GRAB_SIZE,VERSION) VALUES (?,?,?,?) |INSERT INTO 
OJB_HL_SEQ (TABLENAME,MAX_KEY,GRAB_SIZE,VERSION) VALUES 
('SEQ_PERSON','200020','20','1')
1131129201567|2|1|commit||

jakob

Jakob Braeuchi schrieb:
> hi mirko,
> 
> i do have the same problem on ubuntu.
> it looks like if some statements do not return a proper resultset:
> 
> SELECT A0.TABLENAME,A0.MAX_KEY,A0.GRAB_SIZE,A0.VERSION FROM OJB_HL_SEQ 
> A0 WHERE A0.TABLENAME = 'SEQ_PERSON'
> 
> return 0 rows when executed within mysql-query-browser but via jdbc 
> rs#next() returns true ????
> 
> jakob
> 
> mfroehlich@digitalchocolate.com schrieb:
> 
>> At work I am using OJB with MySQL version 4.1.10a-Max on a Redhat
>> Enterprise 3 box. Now I am trying to replicate my work environment at 
>> home
>> on my Ubuntu Linux box. The MySQL version at home is
>> 4.1.12-Debian_1ubuntu3, which while not exactly the same as at work does
>> seem reasonably close. I am running MySQL with the exact same config 
>> as at
>> work (using InnoDB and UTF-8).
>>
>> It looks like OJB can read from the database just fine, but whenever I 
>> try
>> to update or insert data, it fails with an error message (see below).
>>
>> I have tried everything I could think of, such as swapping the OJB 1.0.2
>> JAR we are still using for the latest 1.0.3 JAR (and updating the config
>> files appropriately), swapping the MySQL connector from 3.1.7 to 
>> 3.1.11 (I
>> even tried the 3.2 alpha), etc. No luck...
>>
>> I also tried to google the error message "Incorrect arguments to
>> mysql_stmt_execute", but I wasn't able to turn up anything useful.
>>
>> Does anybody have any ideas what could be causing this?
>>
>> -Mirko
>>
>>
>>     [junit] [EntityPersistence.java:590] Updating entity:
>> ApplicationEntity[shortName: 'DC Sample', fullName: 'DC Sample',
>> reportsScores: '1', applicationKey: 'sampleapp', active: 'false',
>> subscriptionApp: 'false', id: '4', ]
>>     [junit] [org.apache.ojb.broker.accesslayer.JdbcAccessImpl] ERROR:
>> SQLException during the execution of the update (for a
>> com.dchoc.common.entity.ApplicationEntity): Incorrect arguments to
>> mysql_stmt_execute
>>     [junit] Incorrect arguments to mysql_stmt_execute
>>     [junit] java.sql.SQLException: Incorrect arguments to 
>> mysql_stmt_execute
>>     [junit]     at 
>> com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2847)
>>     [junit]     at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1531)
>>     [junit]     at
>> com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1347) 
>>
>>     [junit]     at
>> com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:958) 
>>
>>     [junit]     at
>> com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1957) 
>>
>>     [junit]     at
>> com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1880) 
>>
>>     [junit]     at
>> com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1741) 
>>
>>     [junit]     at
>> org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101) 
>>
>>     [junit]     at
>> org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101) 
>>
>>     [junit]     at
>> org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeUpdate(Unknown
>> Source)
>>     [junit]     at
>> org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Unknown
>> Source)
>>     [junit]     at
>> org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source)
>>     [junit]     at
>> org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source)
>>     [junit]     at
>> org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
>> Source)
>>     [junit]     at
>> org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
>> Source)
>>     [junit]     at
>> com.dchoc.common.entity.EntityPersistence.update(EntityPersistence.java:597) 
>>
>>     [junit]     at
>> com.dchoc.common.entity.EntityPersistence.update(EntityPersistence.java:550) 
>>
>>     [junit]     at
>> com.dchoc.common.home.AbstractHome.update(AbstractHome.java:66)
>>     [junit]     at
>> com.dchoc.common.home.ApplicationHome.update(ApplicationHome.java:251)
>>     [junit]     at
>> com.dchoc.common.home.TestApplicationHome.testUpdate(TestApplicationHome.java:72) 
>>
>>     [junit]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>> Method)
>>     [junit]     at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
>>
>>     [junit]     at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
>>
>>     [junit]     at java.lang.reflect.Method.invoke(Method.java:324)
>>     [junit]     at junit.framework.TestCase.runTest(TestCase.java:154)
>>     [junit]     at junit.framework.TestCase.runBare(TestCase.java:127)
>>     [junit]     at 
>> junit.framework.TestResult$1.protect(TestResult.java:106)
>>     [junit]     at
>> junit.framework.TestResult.runProtected(TestResult.java:124)
>>     [junit]     at junit.framework.TestResult.run(TestResult.java:109)
>>     [junit]     at junit.framework.TestCase.run(TestCase.java:118)
>>     [junit]     at junit.framework.TestSuite.runTest(TestSuite.java:208)
>>     [junit]     at junit.framework.TestSuite.run(TestSuite.java:203)
>>     [junit]     at
>> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:297) 
>>
>>     [junit]     at
>> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:672) 
>>
>>     [junit]     at
>> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:567) 
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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: Incorrect arguments to mysql_stmt_execute

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

i do have the same problem on ubuntu.
it looks like if some statements do not return a proper resultset:

SELECT A0.TABLENAME,A0.MAX_KEY,A0.GRAB_SIZE,A0.VERSION FROM OJB_HL_SEQ 
A0 WHERE A0.TABLENAME = 'SEQ_PERSON'

return 0 rows when executed within mysql-query-browser but via jdbc 
rs#next() returns true ????

jakob

mfroehlich@digitalchocolate.com schrieb:
> At work I am using OJB with MySQL version 4.1.10a-Max on a Redhat
> Enterprise 3 box. Now I am trying to replicate my work environment at home
> on my Ubuntu Linux box. The MySQL version at home is
> 4.1.12-Debian_1ubuntu3, which while not exactly the same as at work does
> seem reasonably close. I am running MySQL with the exact same config as at
> work (using InnoDB and UTF-8).
> 
> It looks like OJB can read from the database just fine, but whenever I try
> to update or insert data, it fails with an error message (see below).
> 
> I have tried everything I could think of, such as swapping the OJB 1.0.2
> JAR we are still using for the latest 1.0.3 JAR (and updating the config
> files appropriately), swapping the MySQL connector from 3.1.7 to 3.1.11 (I
> even tried the 3.2 alpha), etc. No luck...
> 
> I also tried to google the error message "Incorrect arguments to
> mysql_stmt_execute", but I wasn't able to turn up anything useful.
> 
> Does anybody have any ideas what could be causing this?
> 
> -Mirko
> 
> 
>     [junit] [EntityPersistence.java:590] Updating entity:
> ApplicationEntity[shortName: 'DC Sample', fullName: 'DC Sample',
> reportsScores: '1', applicationKey: 'sampleapp', active: 'false',
> subscriptionApp: 'false', id: '4', ]
>     [junit] [org.apache.ojb.broker.accesslayer.JdbcAccessImpl] ERROR:
> SQLException during the execution of the update (for a
> com.dchoc.common.entity.ApplicationEntity): Incorrect arguments to
> mysql_stmt_execute
>     [junit] Incorrect arguments to mysql_stmt_execute
>     [junit] java.sql.SQLException: Incorrect arguments to mysql_stmt_execute
>     [junit]     at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2847)
>     [junit]     at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1531)
>     [junit]     at
> com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1347)
>     [junit]     at
> com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:958)
>     [junit]     at
> com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1957)
>     [junit]     at
> com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1880)
>     [junit]     at
> com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1741)
>     [junit]     at
> org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101)
>     [junit]     at
> org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101)
>     [junit]     at
> org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeUpdate(Unknown
> Source)
>     [junit]     at
> org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Unknown
> Source)
>     [junit]     at
> org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source)
>     [junit]     at
> org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source)
>     [junit]     at
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
> Source)
>     [junit]     at
> org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
> Source)
>     [junit]     at
> com.dchoc.common.entity.EntityPersistence.update(EntityPersistence.java:597)
>     [junit]     at
> com.dchoc.common.entity.EntityPersistence.update(EntityPersistence.java:550)
>     [junit]     at
> com.dchoc.common.home.AbstractHome.update(AbstractHome.java:66)
>     [junit]     at
> com.dchoc.common.home.ApplicationHome.update(ApplicationHome.java:251)
>     [junit]     at
> com.dchoc.common.home.TestApplicationHome.testUpdate(TestApplicationHome.java:72)
>     [junit]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
>     [junit]     at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>     [junit]     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>     [junit]     at java.lang.reflect.Method.invoke(Method.java:324)
>     [junit]     at junit.framework.TestCase.runTest(TestCase.java:154)
>     [junit]     at junit.framework.TestCase.runBare(TestCase.java:127)
>     [junit]     at junit.framework.TestResult$1.protect(TestResult.java:106)
>     [junit]     at
> junit.framework.TestResult.runProtected(TestResult.java:124)
>     [junit]     at junit.framework.TestResult.run(TestResult.java:109)
>     [junit]     at junit.framework.TestCase.run(TestCase.java:118)
>     [junit]     at junit.framework.TestSuite.runTest(TestSuite.java:208)
>     [junit]     at junit.framework.TestSuite.run(TestSuite.java:203)
>     [junit]     at
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:297)
>     [junit]     at
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:672)
>     [junit]     at
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:567)
> 
> 
> ---------------------------------------------------------------------
> 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