gavin wrote:
Try using a different id generation strategy instead of "native". Perhaps your DB2 does not support the "values IDENTITY_VAL_LOCAL()" call.
Thank you ... changing the id generation to "increment" worked and the tables are now getting populated.
Now there's a problem running viewAllAuctionsSlow() and viewAllAuctionsFast() as shown below. The rest of the application runs to completion without error if calls to these methods are commented out.
[java] Viewing all auction item objects
[java] Hibernate: select * from ( select rownumber() over() as row_, auctionite0_.id as id0_, bids1_.id as id1_, user2_.id as id2_, auctionite0_.description as descript2_0_, auctionite0_.ends as ends0_, auctionite0_.condition as condition0_, auctionite0_.seller as seller0_, auctionite0_.successfulBid as successf6_0_, bids1_.isBuyNow as isBuyNow1_, bids1_.amount as amount1_, bids1_.datetime as datetime1_, bids1_.bidder as bidder1_, bids1_.item as item1_, user2_.userName as userName2_, user2_."password" as y3_2_, user2_.email as email2_, user2_.firstName as firstName2_, user2_."initial" as y6_2_, user2_.lastName as lastName2_, bids1_.id as id__, bids1_.item as item__ from AuctionItem auctionite0_ left outer join Bid bids1_ on auctionite0_.id=bids1_.item left outer join AuctionUser user2_ on bids1_.bidder=user2_.id order by auctionite0_.ends desc ) as temp_ where row_ <= ?
[java] 10:33:29,974 WARN JDBCExceptionReporter:38 - SQL Error: -104, SQLState: 42601
[java] 10:33:29,974 ERROR JDBCExceptionReporter:46 - [SQL0104] Token ( was not valid. Valid tokens: , FROM INTO.
[java] 10:33:29,974 WARN JDBCExceptionReporter:38 - SQL Error: -104, SQLState: 42601
[java] 10:33:29,974 ERROR JDBCExceptionReporter:46 - [SQL0104] Token ( was not valid. Valid tokens: , FROM INTO.
[java] 10:33:29,974 ERROR JDBCExceptionReporter:38 - Could not execute query
[java] java.sql.SQLException: [SQL0104] Token ( was not valid. Valid tokens: , FROM INTO.
[java] at com.ibm.as400.access.JDError.throwSQLException(JDError.java:533)
[java] at com.ibm.as400.access.JDError.throwSQLException(JDError.java:504)
[java] at com.ibm.as400.access.AS400JDBCStatement.commonPrepare(AS400JDBCStatement.java:1302)
[java] at com.ibm.as400.access.AS400JDBCPreparedStatement.<init>(AS400JDBCPreparedStatement.java:182)
[java] at com.ibm.as400.access.AS400JDBCConnection.prepareStatement(AS400JDBCConnection.java:1805)
[java] at com.ibm.as400.access.AS400JDBCConnection.prepareStatement(AS400JDBCConnection.java:1628)
[java] at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:233)
[java] at net.sf.hibernate.impl.BatcherImpl.prepareQueryStatement(BatcherImpl.java:61)
[java] at net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:699)
[java] at net.sf.hibernate.loader.Loader.doQuery(Loader.java:180)
[java] at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:128)
[java] at net.sf.hibernate.loader.Loader.list(Loader.java:918)
[java] at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:983)
[java] at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1473)
[java] at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:45)
[java] at org.hibernate.auction.Main.viewAllAuctionsSlow(Main.java:86)
[java] at org.hibernate.auction.Main.main(Main.java:366)
[java] net.sf.hibernate.JDBCException: Could not execute query
[java] at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1476)
[java] at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:45)
[java] at org.hibernate.auction.Main.viewAllAuctionsSlow(Main.java:86)
[java] at org.hibernate.auction.Main.main(Main.java:366)
[java] Caused by: java.sql.SQLException: [SQL0104] Token ( was not valid. Valid tokens: , FROM INTO.
[java] at com.ibm.as400.access.JDError.throwSQLException(JDError.java:533)
[java] at com.ibm.as400.access.JDError.throwSQLException(JDError.java:504)
[java] at com.ibm.as400.access.AS400JDBCStatement.commonPrepare(AS400JDBCStatement.java:1302)
[java] at com.ibm.as400.access.AS400JDBCPreparedStatement.<init>(AS400JDBCPreparedStatement.java:182)
[java] at com.ibm.as400.access.AS400JDBCConnection.prepareStatement(AS400JDBCConnection.java:1805)
[java] at com.ibm.as400.access.AS400JDBCConnection.prepareStatement(AS400JDBCConnection.java:1628)
[java] at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:233)
[java] at net.sf.hibernate.impl.BatcherImpl.prepareQueryStatement(BatcherImpl.java:61)
[java] at net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:699)
[java] at net.sf.hibernate.loader.Loader.doQuery(Loader.java:180)
[java] at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:128)
[java] at net.sf.hibernate.loader.Loader.list(Loader.java:918)
[java] at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:983)
[java] at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1473)
[java] ... 3 more
[java] Exception in thread "main"
[java] Java Result: 1
[echo] for more examples, download the hibernate-examples package
BUILD SUCCESSFUL
Total time: 12 seconds