You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by Gus Heck <gu...@olin.edu> on 2004/01/27 17:35:51 UTC

torqueschema bug?

Not sure if this is the right place to post this, but here goes...

I had an interesting experience with torque recently... I had a field 
that was a nonpersistant class, and torqueshcema decided that it should 
be stored as type "LONGVARBINARY". This caused problems, as when my code 
tried to push that into MySQL 4 it choked probably because (according to 
my MySQL book) MySQL expects it to be "LONG VARBINARY" (note the space) 
or "MEDIUMBLOB".

Attempting to store a non-persistant class was itself a mistake, but the 
DDL generated still appears to be syntactically incorrect and I suspect 
will cause problems in other implementations that do legitamately map 
something to LONG VARBINARY.

-Gus


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


Re: torqueschema bug?

Posted by Thomas Dudziak <to...@first.gmd.de>.
On Fri, 30 Jan 2004, Gus Heck wrote:

> I updated my CVS checkout of OJB hooked it up with my copy of MySQL, and
> dropped the jar for connector 3.0.9 into /lib. I have attached the test
> results. There are 15 tests that fail or cause errors. None seem to
> mention LONGVARBINARY.
> 
> The Torque jar I am getting the issues with using is version 3.0.2,
> which matches what I find in /lib of the ojb cvs checkout.

That's more or less the same errors that I get (MySQL 4.0.12 and
Connector/J 3.0.9), so I would say that there is no error in the Torque
generation stuff per se.
Perhaps you can send me your schema or even the offending source code so
that I can have a deeper look ?

Tom


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


Re: torqueschema bug?

Posted by Gus Heck <gu...@olin.edu>.
------------------------------------------------------------------------
RESEND: The test output attachements must have been too long and choked 
off this message on the way into the mailing list, so where it says 
attachments below, just keep scrolling and you will find pastes of the 
failing tests only with no stdout/stderr included Hopefully this won't 
be too long.
------------------------------------------------------------------------

I updated my CVS checkout of OJB hooked it up with my copy of MySQL, and
dropped the jar for connector 3.0.9 into /lib. I have attached the test
results. There are 15 tests that fail or cause errors. None seem to
mention LONGVARBINARY.

The Torque jar I am getting the issues with using is version 3.0.2,
which matches what I find in /lib of the ojb cvs checkout.

-Gus


--- TEST SUMMARY MYSQL 4.0.14, and CONNECTOR/J 3.0.9 ---

Testsuite: org.apache.ojb.broker.AllTests
Tests run: 326, Failures: 7, Errors: 4, Time elapsed: 45.878 sec

Testsuite: org.apache.ojb.odmg.AllTests
Tests run: 180, Failures: 4, Errors: 2, Time elapsed: 12.488 sec

Testsuite: org.apache.ojb.otm.AllTests
Tests run: 76, Failures: 0, Errors: 4, Time elapsed: 9.022 sec

Testsuite: org.apache.ojb.soda.AllTests
Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 2.207 sec


--- FAILING PB TESTS WITH MYSQL 4.0.14, and CONNECTOR/J 3.0.9 ---

Testcase: testSubQuery2 took 0.092 sec
         Caused an ERROR
org.apache.ojb.broker.PersistenceBrokerSQLException: 
java.sql.SQLException: Syntax error or access violation,  message from 
server: "You have an error in your SQL syntax.  Check the manual that co
rresponds to your MySQL server version for the right syntax to use near 
'SELECT DISTINCT B0.Kategorie_Nr FROM Artikel B0)' at line 1"
org.apache.ojb.broker.PersistenceBrokerException: 
org.apache.ojb.broker.PersistenceBrokerSQLException: 
java.sql.SQLException: Syntax error or access violation,  message from 
server: "You have an e
rror in your SQL syntax.  Check the manual that corresponds to your 
MySQL server version for the right syntax to use near 'SELECT DISTINCT 
B0.Kategorie_Nr FROM Artikel B0)' at line 1"
         at 
org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(QueryReferenceBroker.java:250)
         at 
org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(QueryReferenceBroker.java:262)
         at 
org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBrokerImpl.java:1002)
         at 
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery(DelegatingPersistenceBroker.java:322)
         at 
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery(DelegatingPersistenceBroker.java:322)
         at 
org.apache.ojb.broker.QueryTest.testSubQuery2(QueryTest.java:126)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
Caused by: org.apache.ojb.broker.PersistenceBrokerSQLException: 
java.sql.SQLException: Syntax error or access violation,  message from 
server: "You have an error in your SQL syntax.  Check the man
ual that corresponds to your MySQL server version for the right syntax 
to use near 'SELECT DISTINCT B0.Kategorie_Nr FROM Artikel B0)' at line 1"
         at 
org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeQuery(JdbcAccessImpl.java:356)
         at 
org.apache.ojb.broker.accesslayer.RsQueryObject.performQuery(RsQueryObject.java:113)
         at 
org.apache.ojb.broker.accesslayer.RsIterator.<init>(RsIterator.java:211)
         at 
org.apache.ojb.broker.core.RsIteratorFactoryImpl.createRsIterator(RsIteratorFactoryImpl.java:97)
         at 
org.apache.ojb.broker.core.PersistenceBrokerImpl.getRsIteratorFromQuery(PersistenceBrokerImpl.java:1606)
         at 
org.apache.ojb.broker.core.PersistenceBrokerImpl.getIteratorFromQuery(PersistenceBrokerImpl.java:1119)
         at 
org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(QueryReferenceBroker.java:143)
         at 
org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(QueryReferenceBroker.java:242)
         ... 21 more
Caused by: java.sql.SQLException: Syntax error or access violation, 
message from server: "You have an error in your SQL syntax.  Check the 
manual that corresponds to your MySQL server version for
  the right syntax to use near 'SELECT DISTINCT B0.Kategorie_Nr FROM 
Artikel B0)' at line 1"
         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1825)
         at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1020)
         at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1109)
         at com.mysql.jdbc.Connection.execSQL(Connection.java:2030)
         at 
com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1563)
         at 
org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeQuery(JdbcAccessImpl.java:321)
         ... 28 more

Testcase: testSubQuery1 took 0.024 sec
         Caused an ERROR
org.apache.ojb.broker.PersistenceBrokerSQLException: 
java.sql.SQLException: Syntax error or access violation,  message from 
server: "You have an error in your SQL syntax.  Check the manual that co
rresponds to your MySQL server version for the right syntax to use near 
'SELECT avg(B0.Einzelpreis) FROM Artikel B0 WHERE B0.Artikelname"
org.apache.ojb.broker.PersistenceBrokerException: 
org.apache.ojb.broker.PersistenceBrokerSQLException: 
java.sql.SQLException: Syntax error or access violation,  message from 
server: "You have an e
rror in your SQL syntax.  Check the manual that corresponds to your 
MySQL server version for the right syntax to use near 'SELECT 
avg(B0.Einzelpreis) FROM Artikel B0 WHERE B0.Artikelname"
         at 
org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(QueryReferenceBroker.java:250)
         at 
org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(QueryReferenceBroker.java:262)
         at 
org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBrokerImpl.java:1002)
         at 
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery(DelegatingPersistenceBroker.java:322)
         at 
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery(DelegatingPersistenceBroker.java:322)
         at 
org.apache.ojb.broker.QueryTest.testSubQuery1(QueryTest.java:153)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
Caused by: org.apache.ojb.broker.PersistenceBrokerSQLException: 
java.sql.SQLException: Syntax error or access violation,  message from 
server: "You have an error in your SQL syntax.  Check the man
ual that corresponds to your MySQL server version for the right syntax 
to use near 'SELECT avg(B0.Einzelpreis) FROM Artikel B0 WHERE 
B0.Artikelname"
         at 
org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeQuery(JdbcAccessImpl.java:356)
         at 
org.apache.ojb.broker.accesslayer.RsQueryObject.performQuery(RsQueryObject.java:113)
         at 
org.apache.ojb.broker.accesslayer.RsIterator.<init>(RsIterator.java:211)
         at 
org.apache.ojb.broker.core.RsIteratorFactoryImpl.createRsIterator(RsIteratorFactoryImpl.java:97)
         at 
org.apache.ojb.broker.core.PersistenceBrokerImpl.getRsIteratorFromQuery(PersistenceBrokerImpl.java:1619)
         at 
org.apache.ojb.broker.core.PersistenceBrokerImpl.getIteratorFromQuery(PersistenceBrokerImpl.java:1119)
         at 
org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(QueryReferenceBroker.java:143)
         at 
org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(QueryReferenceBroker.java:242)
         ... 21 more
Caused by: java.sql.SQLException: Syntax error or access violation, 
message from server: "You have an error in your SQL syntax.  Check the 
manual that corresponds to your MySQL server version for
  the right syntax to use near 'SELECT avg(B0.Einzelpreis) FROM Artikel 
B0 WHERE B0.Artikelname"
         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1825)
         at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1020)
         at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1109)
         at com.mysql.jdbc.Connection.execSQL(Connection.java:2030)
         at 
com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1563)
         at 
org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeQuery(JdbcAccessImpl.java:321)
         ... 28 more

Testcase: testSubQuery3 took 0.005 sec
         Caused an ERROR
org.apache.ojb.broker.PersistenceBrokerSQLException: 
java.sql.SQLException: Syntax error or access violation,  message from 
server: "You have an error in your SQL syntax.  Check the manual that co
rresponds to your MySQL server version for the right syntax to use near 
'SELECT count(B0.Kategorie_Nr) FROM Artikel B0 WHERE B0.Kategori"
org.apache.ojb.broker.PersistenceBrokerException: 
org.apache.ojb.broker.PersistenceBrokerSQLException: 
java.sql.SQLException: Syntax error or access violation,  message from 
server: "You have an e
rror in your SQL syntax.  Check the manual that corresponds to your 
MySQL server version for the right syntax to use near 'SELECT 
count(B0.Kategorie_Nr) FROM Artikel B0 WHERE B0.Kategori"
         at 
org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(QueryReferenceBroker.java:250)
         at 
org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(QueryReferenceBroker.java:262)
         at 
org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBrokerImpl.java:1002)
         at 
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery(DelegatingPersistenceBroker.java:322)
         at 
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery(DelegatingPersistenceBroker.java:322)
         at 
org.apache.ojb.broker.QueryTest.testSubQuery3(QueryTest.java:181)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
Caused by: org.apache.ojb.broker.PersistenceBrokerSQLException: 
java.sql.SQLException: Syntax error or access violation,  message from 
server: "You have an error in your SQL syntax.  Check the man
ual that corresponds to your MySQL server version for the right syntax 
to use near 'SELECT count(B0.Kategorie_Nr) FROM Artikel B0 WHERE 
B0.Kategori"
         at 
org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeQuery(JdbcAccessImpl.java:356)
         at 
org.apache.ojb.broker.accesslayer.RsQueryObject.performQuery(RsQueryObject.java:113)
         at 
org.apache.ojb.broker.accesslayer.RsIterator.<init>(RsIterator.java:211)
         at 
org.apache.ojb.broker.core.RsIteratorFactoryImpl.createRsIterator(RsIteratorFactoryImpl.java:97)
         at 
org.apache.ojb.broker.core.PersistenceBrokerImpl.getRsIteratorFromQuery(PersistenceBrokerImpl.java:1606)
         at 
org.apache.ojb.broker.core.PersistenceBrokerImpl.getIteratorFromQuery(PersistenceBrokerImpl.java:1119)
         at 
org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(QueryReferenceBroker.java:143)
         at 
org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(QueryReferenceBroker.java:242)
         ... 21 more
Caused by: java.sql.SQLException: Syntax error or access violation, 
message from server: "You have an error in your SQL syntax.  Check the 
manual that corresponds to your MySQL server version for
  the right syntax to use near 'SELECT count(B0.Kategorie_Nr) FROM 
Artikel B0 WHERE B0.Kategori"
         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1825)
         at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1020)
         at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1109)
         at com.mysql.jdbc.Connection.execSQL(Connection.java:2030)
         at 
com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1563)
         at 
org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeQuery(JdbcAccessImpl.java:321)
         ... 28 more

Testcase: testSubQuery4 took 0.006 sec
         Caused an ERROR
org.apache.ojb.broker.PersistenceBrokerSQLException: 
java.sql.SQLException: Syntax error or access violation,  message from 
server: "You have an error in your SQL syntax.  Check the manual that co
rresponds to your MySQL server version for the right syntax to use near 
'SELECT count(B0.Kategorie_Nr) FROM Artikel B0 WHERE B0.Kategori"
org.apache.ojb.broker.PersistenceBrokerException: 
org.apache.ojb.broker.PersistenceBrokerSQLException: 
java.sql.SQLException: Syntax error or access violation,  message from 
server: "You have an e
rror in your SQL syntax.  Check the manual that corresponds to your 
MySQL server version for the right syntax to use near 'SELECT 
count(B0.Kategorie_Nr) FROM Artikel B0 WHERE B0.Kategori"
         at 
org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(QueryReferenceBroker.java:250)
         at 
org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(QueryReferenceBroker.java:262)
         at 
org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery(PersistenceBrokerImpl.java:1002)
         at 
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery(DelegatingPersistenceBroker.java:322)
         at 
org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery(DelegatingPersistenceBroker.java:322)
         at 
org.apache.ojb.broker.QueryTest.testSubQuery4(QueryTest.java:206)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
Caused by: org.apache.ojb.broker.PersistenceBrokerSQLException: 
java.sql.SQLException: Syntax error or access violation,  message from 
server: "You have an error in your SQL syntax.  Check the man
ual that corresponds to your MySQL server version for the right syntax 
to use near 'SELECT count(B0.Kategorie_Nr) FROM Artikel B0 WHERE 
B0.Kategori"
         at 
org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeQuery(JdbcAccessImpl.java:356)
         at 
org.apache.ojb.broker.accesslayer.RsQueryObject.performQuery(RsQueryObject.java:113)
         at 
org.apache.ojb.broker.accesslayer.RsIterator.<init>(RsIterator.java:211)
         at 
org.apache.ojb.broker.core.RsIteratorFactoryImpl.createRsIterator(RsIteratorFactoryImpl.java:97)
         at 
org.apache.ojb.broker.core.PersistenceBrokerImpl.getRsIteratorFromQuery(PersistenceBrokerImpl.java:1606)
         at 
org.apache.ojb.broker.core.PersistenceBrokerImpl.getIteratorFromQuery(PersistenceBrokerImpl.java:1119)
         at 
org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(QueryReferenceBroker.java:143)
         at 
org.apache.ojb.broker.core.QueryReferenceBroker.getCollectionByQuery(QueryReferenceBroker.java:242)
         ... 21 more
Caused by: java.sql.SQLException: Syntax error or access violation, 
message from server: "You have an error in your SQL syntax.  Check the 
manual that corresponds to your MySQL server version for
  the right syntax to use near 'SELECT count(B0.Kategorie_Nr) FROM 
Artikel B0 WHERE B0.Kategori"
         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1825)
         at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1020)
         at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1109)
         at com.mysql.jdbc.Connection.execSQL(Connection.java:2030)
         at 
com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1563)
         at 
org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeQuery(JdbcAccessImpl.java:321)
         ... 28 more

Testcase: testReportPathExpressionForExtents2 took 0.005 sec
         FAILED
check size expected:<3> but was:<2>
junit.framework.AssertionFailedError: check size expected:<3> but was:<2>
         at 
org.apache.ojb.broker.QueryTest.testReportPathExpressionForExtents2(QueryTest.java:913)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

Testcase: testDeleteWithRemovalAwareCollection took 0.027 sec
         FAILED
expected:<1> but was:<2>
junit.framework.AssertionFailedError: expected:<1> but was:<2>
         at 
org.apache.ojb.broker.OneToManyTest.testDeleteWithRemovalAwareCollection(OneToManyTest.java:73)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

Testcase: testUserRollbackClearCache took 0.072 sec
         FAILED
expected:<60> but was:<70>
junit.framework.AssertionFailedError: expected:<60> but was:<70>
         at 
org.apache.ojb.broker.PBRollbackTest.testUserRollbackClearCache(PBRollbackTest.java:188)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

Testcase: testUserRollback took 0.058 sec
         FAILED
expected:<80> but was:<90>
junit.framework.AssertionFailedError: expected:<80> but was:<90>
         at 
org.apache.ojb.broker.PBRollbackTest.testUserRollback(PBRollbackTest.java:228)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

Testcase: testRollbackCausedByNotExistingObject took 0.024 sec
         FAILED
Object count does not match after rollback expected:<100> but was:<110>
junit.framework.AssertionFailedError: Object count does not match after 
rollback expected:<100> but was:<110>
         at 
org.apache.ojb.broker.PBRollbackTest.testRollbackCausedByNotExistingObject(PBRollbackTest.java:280)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

Testcase: testRollbackCausedBySQLException took 0.016 sec
         FAILED
Test should throw a exception in place
junit.framework.AssertionFailedError: Test should throw a exception in place
         at 
org.apache.ojb.broker.PBRollbackTest.testRollbackCausedBySQLException(PBRollbackTest.java:317)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

Testcase: testMultipleInsertAndRollback took 5.251 sec
         FAILED
expected:<2000> but was:<4000>
junit.framework.AssertionFailedError: expected:<2000> but was:<4000>
         at 
org.apache.ojb.broker.sequence.SMMultiThreadedTest.checkGeneratedObjects(SMMultiThreadedTest.java:81)
         at 
org.apache.ojb.broker.sequence.SMMultiThreadedTest.testMultipleInsertAndRollback(SMMultiThreadedTest.java:56)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at 
org.apache.ojb.broker.JUnitExtensions$MultiThreadedTestCase.run(JUnitExtensions.java:107)




--- FAILING ODMG TESTS WITH MYSQL 4.0.14, and CONNECTOR/J 3.0.9 ---

Testcase: testTransactionFlush took 0.02 sec
         FAILED
We should not find objects from aborted tx
junit.framework.AssertionFailedError: We should not find objects from 
aborted tx
         at 
org.apache.ojb.odmg.ODMGRollbackTest.testTransactionFlush(ODMGRollbackTest.java:91)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

Testcase: testResultsWhileTransactionWithCheckpoint took 0.572 sec
         Caused an ERROR
null
org.apache.ojb.odmg.TransactionAbortedExceptionOJB
         at 
org.apache.ojb.odmg.ObjectEnvelopeTable.commit(ObjectEnvelopeTable.java:217)
         at 
org.apache.ojb.odmg.TransactionImpl.doCommitOnObjects(TransactionImpl.java:340)
         at 
org.apache.ojb.odmg.TransactionImpl.checkpoint(TransactionImpl.java:474)
         at 
org.apache.ojb.odmg.ODMGRollbackTest.testResultsWhileTransactionWithCheckpoint(ODMGRollbackTest.java:132)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
Caused by: org.apache.ojb.broker.PersistenceBrokerSQLException: SQL 
failure while insert object data for class org.apache.ojb.broker.Role, 
PK of the given object is [ person_id=121 project_id=163]
, object was 
org.apache.ojb.broker.Role@8890da[roleName=<null>,personId=121,person=ThreadedUsingBroker_1075391120962,projectId=163,project=ThreadedUsingBroker_1075391120962 
[ThreadedUsingBroker_10
75391120962],tasks=[]], exception message is [Invalid argument value, 
message from server: "Duplicate entry '121-163' for key 1"]
         at 
org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeInsert(JdbcAccessImpl.java:281)
         at 
org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(PersistenceBrokerImpl.java:1389)
         at 
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl.java:1306)
         at 
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl.java:1266)
         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)
         ... 19 more
Caused by: java.sql.SQLException: Invalid argument value,  message from 
server: "Duplicate entry '121-163' for key 1"
         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1825)
         at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1020)
         at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1109)
         at com.mysql.jdbc.Connection.execSQL(Connection.java:2030)
         at 
com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1750)
         at 
com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1596)
         at 
org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeInsert(JdbcAccessImpl.java:236)
         ... 27 more

Testcase: testResultsAfterTransaction took 0.399 sec
         Caused an ERROR
null
org.apache.ojb.odmg.TransactionAbortedExceptionOJB
         at 
org.apache.ojb.odmg.ObjectEnvelopeTable.commit(ObjectEnvelopeTable.java:217)
         at 
org.apache.ojb.odmg.TransactionImpl.doCommitOnObjects(TransactionImpl.java:340)
         at 
org.apache.ojb.odmg.TransactionImpl.prepare(TransactionImpl.java:661)
         at 
org.apache.ojb.odmg.TransactionImpl.commit(TransactionImpl.java:618)
         at 
org.apache.ojb.odmg.ODMGRollbackTest.getDBObjectCountViaOqlQueryUseNewTransaction(ODMGRollbackTest.java:522)
         at 
org.apache.ojb.odmg.ODMGRollbackTest.testResultsAfterTransaction(ODMGRollbackTest.java:203)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
Caused by: org.apache.ojb.broker.PersistenceBrokerSQLException: SQL 
failure while insert object data for class org.apache.ojb.broker.Role, 
PK of the given object is [ person_id=54 project_id=128],
  object was 
org.apache.ojb.broker.Role@1c293f8[roleName=<null>,personId=54,person=ThreadedUsingBroker_1075391119881,projectId=128,project=ThreadedUsingBroker_1075391119881 
[ThreadedUsingBroker_107
5391119881],tasks=[]], exception message is [Invalid argument value, 
message from server: "Duplicate entry '54-128' for key 1"]
         at 
org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeInsert(JdbcAccessImpl.java:281)
         at 
org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(PersistenceBrokerImpl.java:1389)
         at 
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl.java:1306)
         at 
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(PersistenceBrokerImpl.java:1266)
         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)
         ... 21 more
Caused by: java.sql.SQLException: Invalid argument value,  message from 
server: "Duplicate entry '54-128' for key 1"
         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1825)
         at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1020)
         at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1109)
         at com.mysql.jdbc.Connection.execSQL(Connection.java:2030)
         at 
com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1750)
         at 
com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1596)
         at 
org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeInsert(JdbcAccessImpl.java:236)
         ... 29 more



--- FAILING OTM TESTS WITH MYSQL 4.0.14, and CONNECTOR/J 3.0.9 ---

estcase: testOtmCache took 0.052 sec
         Caused an ERROR
null
java.lang.NullPointerException
         at 
org.apache.ojb.otm.OtmExamples.testOtmCache(OtmExamples.java:343)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

Testcase: testOtmIsolation took 0.016 sec
         Caused an ERROR
SQL failure while insert object data for class 
org.apache.ojb.broker.ProductGroup, PK of the given object is [ 
groupId=77777], object was ----
group Id:    77777
name:        1
description: null
articles in group: null, exception message is [Invalid argument value, 
message from server: "Duplicate entry '77777' for key 1"]
org.apache.ojb.otm.core.TransactionAbortedException: SQL failure while 
insert object data for class org.apache.ojb.broker.ProductGroup, PK of 
the given object is [ groupId=77777], object was ----
group Id:    77777
name:        1
description: null
articles in group: null, exception message is [Invalid argument value, 
message from server: "Duplicate entry '77777' for key 1"]
         at 
org.apache.ojb.otm.core.ConcreteEditingContext.checkpointInternal(ConcreteEditingContext.java:670)
         at 
org.apache.ojb.otm.core.ConcreteEditingContext.commit(ConcreteEditingContext.java:428)
         at org.apache.ojb.otm.core.Transaction.commit(Transaction.java:147)
         at 
org.apache.ojb.otm.OtmExamples.testOtmIsolation(OtmExamples.java:394)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

Testcase: testOtmLocks took 0.005 sec
         Caused an ERROR
SQL failure while insert object data for class 
org.apache.ojb.broker.ProductGroup, PK of the given object is [ 
groupId=77777], object was ----
group Id:    77777
name:        1
description: null
articles in group: null, exception message is [Invalid argument value, 
message from server: "Duplicate entry '77777' for key 1"]
org.apache.ojb.otm.core.TransactionAbortedException: SQL failure while 
insert object data for class org.apache.ojb.broker.ProductGroup, PK of 
the given object is [ groupId=77777], object was ----
group Id:    77777
name:        1
description: null
articles in group: null, exception message is [Invalid argument value, 
message from server: "Duplicate entry '77777' for key 1"]
         at 
org.apache.ojb.otm.core.ConcreteEditingContext.checkpointInternal(ConcreteEditingContext.java:670)
         at 
org.apache.ojb.otm.core.ConcreteEditingContext.commit(ConcreteEditingContext.java:428)
         at org.apache.ojb.otm.core.Transaction.commit(Transaction.java:147)
         at 
org.apache.ojb.otm.OtmExamples.testOtmLocks(OtmExamples.java:462)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

Testcase: testUpdateByReachability took 0.034 sec
         Caused an ERROR
SQL failure while insert object data for class 
org.apache.ojb.broker.ProductGroup, PK of the given object is [ 
groupId=77777], object was ----
group Id:    77777
name:        1
description: null
articles in group: [----
Article No:   77777
Description:  null
ProductGroupId: 0
ProductGroupName: 1
stock:        333
price:        0.0
stock-value   0.0
, ----
Article No:   77778
Description:  null
ProductGroupId: 0
ProductGroupName: 1
stock:        334
price:        0.0
stock-value   0.0
], exception message is [Invalid argument value,  message from server: 
"Duplicate entry '77777' for key 1"]
org.apache.ojb.otm.core.TransactionAbortedException: SQL failure while 
insert object data for class org.apache.ojb.broker.ProductGroup, PK of 
the given object is [ groupId=77777], object was ----
group Id:    77777
name:        1
description: null
articles in group: [----
Article No:   77777
Description:  null
ProductGroupId: 0
ProductGroupName: 1
stock:        333
price:        0.0
stock-value   0.0
, ----
Article No:   77778
Description:  null
ProductGroupId: 0
ProductGroupName: 1
stock:        334
price:        0.0
stock-value   0.0
], exception message is [Invalid argument value,  message from server: 
"Duplicate entry '77777' for key 1"]
         at 
org.apache.ojb.otm.core.ConcreteEditingContext.checkpointInternal(ConcreteEditingContext.java:670)
         at 
org.apache.ojb.otm.core.ConcreteEditingContext.commit(ConcreteEditingContext.java:428)
         at org.apache.ojb.otm.core.Transaction.commit(Transaction.java:147)
         at 
org.apache.ojb.otm.OtmExamples.testUpdateByReachability(OtmExamples.java:630)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)



Thomas Dudziak wrote:

>On Wed, 28 Jan 2004, Gus Heck wrote:
>
>  
>
>>Modifying the Database with the following commands:
>>
>>ALTER TABLE AddressBase
>>    ADD test LONGVARBINARY NULL ;
>>
>>java.sql.SQLException: Syntax error or access violation,  message from 
>>server: "You have an error in your SQL syntax.  Check the manual that 
>>corresponds to your MySQL server version for the right syntax to use 
>>near 'LONGVARBINARY NULL' at line 2"
>>    
>>
>
>You're right mysql does not seem to support the generic SQL datatype
>LONGVARBINARY (I checked against MySQL 3).
>
>  
>
>>Pasting the generated SQL directly into MySQL shell client I get:
>>
>>mysql> ALTER TABLE AddressBase
>>    ->     ADD test LONGVARBINARY NULL ;
>>ERROR 1064: You have an error in your SQL syntax.  Check the manual that 
>>corresponds to your MySQL server version for the right syntax to use 
>>near 'LONGVARBINARY NULL' at line 2
>>mysql>
>>    
>>
>
>This is what I found strange. LONGVARBINARY is a jdbc datatype (as you can
>see in the doc for java.sql.Types), and for MySQL Torque should generate
>SQL that uses the LONGBLOB sql type. I checked with the OJB unit tests
>(several internal tables use LONGVARBINARY, e.g. DListImpl), and Torque
>(the version that comes with OJB) correctly generates sql that uses
>LONGBLOB thus the unit tests run without problems, e.g.
>
># -----------------------------------------------------------------------
># OJB_DLIST_ENTRIES
># -----------------------------------------------------------------------
>drop table if exists OJB_DLIST_ENTRIES;
>
>CREATE TABLE OJB_DLIST_ENTRIES
>(
>        ID INTEGER NOT NULL,
>        DLIST_ID INTEGER NOT NULL,
>        POSITION_ INTEGER,
>        OID_ LONGBLOB,
>    PRIMARY KEY(ID)
>);
>
>Could you run the unit tests of OJB against MySQL (same configuration as
>your test), and see if the problem persists ? Perhaps you have an older
>version of Torque ?
> 
>Tom
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>For additional commands, e-mail: ojb-dev-help@db.apache.org
>
>  
>




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


Re: torqueschema bug?

Posted by Thomas Dudziak <to...@first.gmd.de>.
On Wed, 28 Jan 2004, Gus Heck wrote:

> Modifying the Database with the following commands:
> 
> ALTER TABLE AddressBase
>     ADD test LONGVARBINARY NULL ;
> 
> java.sql.SQLException: Syntax error or access violation,  message from 
> server: "You have an error in your SQL syntax.  Check the manual that 
> corresponds to your MySQL server version for the right syntax to use 
> near 'LONGVARBINARY NULL' at line 2"

You're right mysql does not seem to support the generic SQL datatype
LONGVARBINARY (I checked against MySQL 3).

> Pasting the generated SQL directly into MySQL shell client I get:
> 
> mysql> ALTER TABLE AddressBase
>     ->     ADD test LONGVARBINARY NULL ;
> ERROR 1064: You have an error in your SQL syntax.  Check the manual that 
> corresponds to your MySQL server version for the right syntax to use 
> near 'LONGVARBINARY NULL' at line 2
> mysql>

This is what I found strange. LONGVARBINARY is a jdbc datatype (as you can
see in the doc for java.sql.Types), and for MySQL Torque should generate
SQL that uses the LONGBLOB sql type. I checked with the OJB unit tests
(several internal tables use LONGVARBINARY, e.g. DListImpl), and Torque
(the version that comes with OJB) correctly generates sql that uses
LONGBLOB thus the unit tests run without problems, e.g.

# -----------------------------------------------------------------------
# OJB_DLIST_ENTRIES
# -----------------------------------------------------------------------
drop table if exists OJB_DLIST_ENTRIES;

CREATE TABLE OJB_DLIST_ENTRIES
(
        ID INTEGER NOT NULL,
        DLIST_ID INTEGER NOT NULL,
        POSITION_ INTEGER,
        OID_ LONGBLOB,
    PRIMARY KEY(ID)
);

Could you run the unit tests of OJB against MySQL (same configuration as
your test), and see if the problem persists ? Perhaps you have an older
version of Torque ?
 
Tom



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


Re: torqueschema bug?

Posted by Gus Heck <gu...@olin.edu>.
Yup it is the 3.0.9-stable connector. I changed drivers and jdbc level 
as suggested and I intentionally duplicated the problem. This time I 
saved the output:

Modifying the Database with the following commands:

ALTER TABLE AddressBase
    ADD test LONGVARBINARY NULL ;

java.sql.SQLException: Syntax error or access violation,  message from 
server: "You have an error in your SQL syntax.  Check the manual that 
corresponds to your MySQL server version for the right syntax to use 
near 'LONGVARBINARY NULL' at line 2"
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1825)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1020)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1109)
        at com.mysql.jdbc.MysqlIO.sqlQuery(MysqlIO.java:1070)
        at com.mysql.jdbc.Connection.execSQL(Connection.java:2027)
        at com.mysql.jdbc.Connection.execSQL(Connection.java:1984)
        at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1248)
        at com.mysql.jdbc.Statement.executeUpdate(Statement.java:1194)
        at 
org.apache.commons.sql.util.DDLExecutor.evaluateBatch(DDLExecutor.java:232)
        at 
org.cs101.fdb.impl.jdo.PersistenceHelper.<clinit>(PersistenceHelper.java:159)
        at org.cs101.fdb.test.DbTestCase.<clinit>(DbTestCase.java:36)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:141)
        at 
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.<init>(JUnitTestRunner.java:237)
        at 
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.<init>(JUnitTestRunner.java:210)
        at 
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:520)
Exception in thread "main" java.lang.ExceptionInInitializerError
        at org.cs101.fdb.test.DbTestCase.<clinit>(DbTestCase.java:36)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:141)
        at 
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.<init>(JUnitTestRunner.java:237)
        at 
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.<init>(JUnitTestRunner.java:210)
        at 
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:520)
Caused by: java.lang.RuntimeException:  !!!! Exceptions while executing 
Data base Alterations !!!!
 Corruption of Database Likely!!!
        at 
org.cs101.fdb.impl.jdo.PersistenceHelper.<clinit>(PersistenceHelper.java:162)
        ... 6 more

The column from the Xdoclet generated torque schema looks like this:

        <column name="test"
                javaName="test"
                type="LONGVARBINARY"
        />

The field in the java class looks like this:

    /**
     * @ojb.field
     */
    Address test;

(address is a non-persistant class (interface actually) which, as noted 
before, is an error but happens to generate the rejected sql)

The code makes other alterations and table creations etc without 
difficulty so it is not likely to be an access privilages issue. To 
check that it was not a sql generation issue with commons sql I fired up 
my sql command line client and logged in as root.

Pasting the generated SQL directly into MySQL shell client I get:

mysql> ALTER TABLE AddressBase
    ->     ADD test LONGVARBINARY NULL ;
ERROR 1064: You have an error in your SQL syntax.  Check the manual that 
corresponds to your MySQL server version for the right syntax to use 
near 'LONGVARBINARY NULL' at line 2
mysql>

Pasting in an altered version with the added space that is suggested by 
reading table 11.7 on pp.149-150 of _Core MySQL_ by Leon Atkinson gives:

mysql> ALTER TABLE AddressBase
    ->     ADD test LONG VARBINARY NULL ;
Query OK, 0 rows affected (0.00 sec)
Records: 0  Duplicates: 0  Warnings: 0

mysql>

Looks like Leon has it right at least as far as what MySQL actually 
accepts...

I don't know if this is MySQL not following SQL specs or torqueschema 
not properly accounting for acceptable differences in the MySQL 
implementation, but the bottom line is LONGVARBINARY does not work with 
MySQL 4 and somebody here or there probably ought to change something so 
that torqueschema and MySQL4 can play nicely with each other. Even 
though I only ran into this by accident, someone else will likely need 
it eventually.

-Gus

Thomas Dudziak wrote:

>On Wed, 28 Jan 2004, Gus Heck wrote:
>
>  
>
>>Hmm, I am using MySQL 4.0.14-standard with databaseDriver = 
>>org.gjt.mm.mysql.Driver downloaded from thier site at the same time. The 
>>exception I got contained the message containing the usual your sql 
>>stinks message  (there is a problem with your syntax near "LONGVARBINARY 
>>Address" etc) (that is by memory not a paste).
>>    
>>
>
>Then you probably use Connector/J 3.0.9-stable in which case you should
>set in your mysql.profile the driver to com.mysql.jdbc.Driver, and the
>jdbc-level to 3.0.
> 
>Tom
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>For additional commands, e-mail: ojb-dev-help@db.apache.org
>
>  
>



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


Re: torqueschema bug?

Posted by Thomas Dudziak <to...@first.gmd.de>.
On Wed, 28 Jan 2004, Gus Heck wrote:

> Hmm, I am using MySQL 4.0.14-standard with databaseDriver = 
> org.gjt.mm.mysql.Driver downloaded from thier site at the same time. The 
> exception I got contained the message containing the usual your sql 
> stinks message  (there is a problem with your syntax near "LONGVARBINARY 
> Address" etc) (that is by memory not a paste).

Then you probably use Connector/J 3.0.9-stable in which case you should
set in your mysql.profile the driver to com.mysql.jdbc.Driver, and the
jdbc-level to 3.0.
 
Tom



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


Re: torqueschema bug?

Posted by Gus Heck <gu...@olin.edu>.
Hmm, I am using MySQL 4.0.14-standard with databaseDriver = 
org.gjt.mm.mysql.Driver downloaded from thier site at the same time. The 
exception I got contained the message containing the usual your sql 
stinks message  (there is a problem with your syntax near "LONGVARBINARY 
Address" etc) (that is by memory not a paste).

If I have some time later I will see if I can't do the test you describe.

- Gus

Thomas Dudziak wrote:

>On Tue, 27 Jan 2004, Gus Heck wrote:
>
>  
>
>>Not sure if this is the right place to post this, but here goes...
>>
>>I had an interesting experience with torque recently... I had a field 
>>that was a nonpersistant class, and torqueshcema decided that it should 
>>be stored as type "LONGVARBINARY". This caused problems, as when my code 
>>tried to push that into MySQL 4 it choked probably because (according to 
>>my MySQL book) MySQL expects it to be "LONG VARBINARY" (note the space) 
>>or "MEDIUMBLOB".
>>    
>>
>
>In the torque schema, LONGVARBINARY is correct (see dtd at
>http://db.apache.org/torque/generator/database.dtd.txt). The XDoclet OJB
>module uses it when it encounters an not-persistent datatype without a
>predefined mapping.
>As for mysql, I'm not sure whether LONG VARBINARY would be correct
>either. The manual defines neither but mentions that myODBC defines
>LONGVARBINARY for BLOBs (http://www.mysql.com/doc/en/BLOB.html) which
>might also affect the jdbc driver.
>
>So this might be a bug in torque, or a problem with your MySQL version
>(or jdbc-driver which probably does the mapping) ?
>If you're unsure, you could create a simple table with a LONGVARBINARY
>column using with the 'sql' ant task and your jdbc driver and settings.
>
>Tom
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>For additional commands, e-mail: ojb-dev-help@db.apache.org
>
>  
>



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


Re: torqueschema bug?

Posted by Thomas Dudziak <to...@first.gmd.de>.
On Tue, 27 Jan 2004, Gus Heck wrote:

> Not sure if this is the right place to post this, but here goes...
> 
> I had an interesting experience with torque recently... I had a field 
> that was a nonpersistant class, and torqueshcema decided that it should 
> be stored as type "LONGVARBINARY". This caused problems, as when my code 
> tried to push that into MySQL 4 it choked probably because (according to 
> my MySQL book) MySQL expects it to be "LONG VARBINARY" (note the space) 
> or "MEDIUMBLOB".

In the torque schema, LONGVARBINARY is correct (see dtd at
http://db.apache.org/torque/generator/database.dtd.txt). The XDoclet OJB
module uses it when it encounters an not-persistent datatype without a
predefined mapping.
As for mysql, I'm not sure whether LONG VARBINARY would be correct
either. The manual defines neither but mentions that myODBC defines
LONGVARBINARY for BLOBs (http://www.mysql.com/doc/en/BLOB.html) which
might also affect the jdbc driver.

So this might be a bug in torque, or a problem with your MySQL version
(or jdbc-driver which probably does the mapping) ?
If you're unsure, you could create a simple table with a LONGVARBINARY
column using with the 'sql' ant task and your jdbc driver and settings.

Tom



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