You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by jones henry <sj...@hotmail.com> on 2004/03/05 00:54:36 UTC

Torque Example

Hi All,
I am trying to run the bookstore example explained in the tutorial. I am 
getting an exception during runtime. I am using mysql database. Following is 
the exception. If anybody knows how to solve this problem, please let me 
know.
Thanks,
Jones.
PS: When I tried the same SQL in the mysql console, it works fine.

[DEBUG] IDBroker - -IDBroker thread was started.
[DEBUG] IDBroker - -Forced id retrieval - no available list
[DEBUG] IDBroker - -updateQuantity: UPDATE ID_TABLE SET QUANTITY = 10 WHERE 
TABLE_NAME = 'publisher'
[DEBUG] IDBroker - -updateNextId: UPDATE ID_TABLE SET NEXT_ID = 1050 WHERE 
TABLE_NAME = 'publisher'
java.sql.SQLException: Invalid argument value,  message from server: 
"Duplicate entry '1040' 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 com.workingdogs.village.Record.saveWithInsert(Unknown Source)
	at com.workingdogs.village.Record.save(Unknown Source)
	at com.workingdogs.village.Record.save(Unknown Source)
	at org.apache.torque.util.BasePeer.insertOrUpdateRecord(BasePeer.java:899)
	at org.apache.torque.util.BasePeer.doInsert(BasePeer.java:742)
	at com.kazmier.om.BasePublisherPeer.doInsert(BasePublisherPeer.java:212)
	at com.kazmier.om.BasePublisherPeer.doInsert(BasePublisherPeer.java:556)
	at com.kazmier.om.BasePublisher.save(BasePublisher.java:527)
	at com.kazmier.om.BasePublisher.save(BasePublisher.java:491)
	at com.kazmier.om.BasePublisher.save(BasePublisher.java:471)
	at com.kazmier.Bookstore.main(Bookstore.java:26)
rethrown as org.apache.torque.TorqueException: Invalid argument value,  
message from server: "Duplicate entry '1040' for key 1"
	at org.apache.torque.util.BasePeer.throwTorqueException(BasePeer.java:236)
	at org.apache.torque.util.BasePeer.insertOrUpdateRecord(BasePeer.java:903)
	at org.apache.torque.util.BasePeer.doInsert(BasePeer.java:742)
	at com.kazmier.om.BasePublisherPeer.doInsert(BasePublisherPeer.java:212)
	at com.kazmier.om.BasePublisherPeer.doInsert(BasePublisherPeer.java:556)
	at com.kazmier.om.BasePublisher.save(BasePublisher.java:527)
	at com.kazmier.om.BasePublisher.save(BasePublisher.java:491)
	at com.kazmier.om.BasePublisher.save(BasePublisher.java:471)
	at com.kazmier.Bookstore.main(Bookstore.java:26)
Caused by: java.sql.SQLException: Invalid argument value,  message from 
server: "Duplicate entry '1040' 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 com.workingdogs.village.Record.saveWithInsert(Unknown Source)
	at com.workingdogs.village.Record.save(Unknown Source)
	at com.workingdogs.village.Record.save(Unknown Source)
	at org.apache.torque.util.BasePeer.insertOrUpdateRecord(BasePeer.java:899)
	... 7 more

_________________________________________________________________
Store more e-mails with MSN Hotmail Extra Storage – 4 plans to choose from! 
http://click.atdmt.com/AVE/go/onm00200362ave/direct/01/


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