-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Problem with iterator/not really sure, where the problem is.
PostPosted: Wed Sep 24, 2003 11:09 am 
Newbie

Joined: Wed Sep 17, 2003 8:26 am
Posts: 16
Hi all,

I get the following exception in a small app that replicates data from one database into another. What irritates me, is that the exception is thrown in the iterator that loads objects from the master-database. There should be no updates to the tables in the master-db. At least I didn't plan to change stuff by my app in the master-db.

any suggestions?

jan


16:31:27,453 DEBUG Replication:256 - query: from c in class master.domain.ScanTicket where c.lastModified > ? and c.creationDate < ?
16:31:37,075 WARN JDBCExceptionReporter:38 - SQL Error: 0, SQLState: null
16:31:37,079 ERROR JDBCExceptionReporter:46 - Batch-Anweisung Nummer 14 (update scanticket set user_id=null, ticket_value=0.0, last_modified='2003-05-15 10:51:26.076000000+00', creation_date='2003-05-15 10:27:01.221000000+00', closing_date='2003-09-24 14:03:26.701000000+00', store_id=1000154590, client_id='scan103', status='closed', ticket_id='00000001000884240', units_reported=0, units_scanned=24, units_counted=24, time_id=4020575, deliveredtime_id=4020563 where scanticket_id=1000884240) wurde abgebrochen.
16:31:37,087 WARN JDBCExceptionReporter:38 - SQL Error: 0, SQLState: null
16:31:37,090 ERROR JDBCExceptionReporter:46 - ERROR: deadlock detected

16:31:37,092 WARN JDBCExceptionReporter:38 - SQL Error: 0, SQLState: null
16:31:37,095 ERROR JDBCExceptionReporter:46 - Batch-Anweisung Nummer 14 (update scanticket set user_id=null, ticket_value=0.0, last_modified='2003-05-15 10:51:26.076000000+00', creation_date='2003-05-15 10:27:01.221000000+00', closing_date='2003-09-24 14:03:26.701000000+00', store_id=1000154590, client_id='scan103', status='closed', ticket_id='00000001000884240', units_reported=0, units_scanned=24, units_counted=24, time_id=4020575, deliveredtime_id=4020563 where scanticket_id=1000884240) wurde abgebrochen.
16:31:37,105 WARN JDBCExceptionReporter:38 - SQL Error: 0, SQLState: null
16:31:37,106 ERROR JDBCExceptionReporter:46 - ERROR: deadlock detected

16:31:37,110 ERROR JDBCExceptionReporter:37 - Could not synchronize database state with session
Batch-Anweisung Nummer 14 (update scanticket set user_id=null, ticket_value=0.0, last_modified='2003-05-15 10:51:26.076000000+00', creation_date='2003-05-15 10:27:01.221000000+00', closing_date='2003-09-24 14:03:26.701000000+00', store_id=1000154590, client_id='scan103', status='closed', ticket_id='00000001000884240', units_reported=0, units_scanned=24, units_counted=24, time_id=4020575, deliveredtime_id=4020563 where scanticket_id=1000884240) wurde abgebrochen.
at org.postgresql.jdbc2.Statement.executeBatch(Statement.java:201)
at net.sf.hibernate.impl.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:50)
at net.sf.hibernate.impl.BatchingBatcher.addToBatch(BatchingBatcher.java:30)
at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:633)
at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:602)
at net.sf.hibernate.impl.ScheduledUpdate.execute(ScheduledUpdate.java:27)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2101)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2074)
at net.sf.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:1579)
at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1385)
at net.sf.hibernate.impl.SessionImpl.iterate(SessionImpl.java:1409)
at net.sf.hibernate.impl.SessionImpl.iterate(SessionImpl.java:1399)
at de.janheise.Query.findObjectsIterator(Query.java:91)
at de.janheise.replication.Replication.findModifiedObjects(Replication.java:258)
at de.janheise.replication.Replication.replicate(Replication.java:188)
at de.janheise.replication.Replication.importExport(Replication.java:163)
at de.janheise.replication.Replication.main(Replication.java:348)
16:31:37,125 ERROR Query:93 - Error querying: from c in class master.domain.ScanTicket where c.lastModified > Thu Jan 01 01:00:00 CET 1970 and c.creationDate < Wed Sep 24 15:43:36 CEST 2003
Batch-Anweisung Nummer 14 (update scanticket set user_id=null, ticket_value=0.0, last_modified='2003-05-15 10:51:26.076000000+00', creation_date='2003-05-15 10:27:01.221000000+00', closing_date='2003-09-24 14:03:26.701000000+00', store_id=1000154590, client_id='scan103', status='closed', ticket_id='00000001000884240', units_reported=0, units_scanned=24, units_counted=24, time_id=4020575, deliveredtime_id=4020563 where scanticket_id=1000884240) wurde abgebrochen.
at org.postgresql.jdbc2.Statement.executeBatch(Statement.java:201)
at net.sf.hibernate.impl.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:50)
at net.sf.hibernate.impl.BatchingBatcher.addToBatch(BatchingBatcher.java:30)
at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:633)
at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:602)
at net.sf.hibernate.impl.ScheduledUpdate.execute(ScheduledUpdate.java:27)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2101)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2074)
at net.sf.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:1579)
at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1385)
at net.sf.hibernate.impl.SessionImpl.iterate(SessionImpl.java:1409)
at net.sf.hibernate.impl.SessionImpl.iterate(SessionImpl.java:1399)
at de.nchmarketing.nchwebworx.management.Query.findObjectsIterator(Query.java:91)
at de.janheise.replication.Replication.findModifiedObjects(Replication.java:258)
at de.janheise.replication.Replication.replicate(Replication.java:188)
at de.janheise.replication.Replication.importExport(Replication.java:163)
at de.janheise.replication.Replication.main(Replication.java:348)
rethrown as
net.sf.hibernate.JDBCException: Could not synchronize database state with session: Batch-Anweisung Nummer 14 (update scanticket set user_id=null, ticket_value=0.0, last_modified='2003-05-15 10:51:26.076000000+00', creation_date='2003-05-15 10:27:01.221000000+00', closing_date='2003-09-24 14:03:26.701000000+00', store_id=1000154590, client_id='scan103', status='closed', ticket_id='00000001000884240', units_reported=0, units_scanned=24, units_counted=24, time_id=4020575, deliveredtime_id=4020563 where scanticket_id=1000884240) wurde abgebrochen.
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2081)
at net.sf.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:1579)
at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1385)
at net.sf.hibernate.impl.SessionImpl.iterate(SessionImpl.java:1409)
at net.sf.hibernate.impl.SessionImpl.iterate(SessionImpl.java:1399)
at de.janheise.Query.findObjectsIterator(Query.java:91)
at de.janheise.replication.Replication.findModifiedObjects(Replication.java:258)
at de.janheise.replication.Replication.replicate(Replication.java:188)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 24, 2003 6:15 pm 
Beginner
Beginner

Joined: Wed Sep 10, 2003 5:34 pm
Posts: 36
Location: New York, NY
Hibernate may just be checking the session against the database to see if any updates do need to be made, perhaps in the data loading session you could set session.setFlushMode(FlushMode.NEVER) so that when the session goes out of scope it won't even check to see if it needs to update.

Matt


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 25, 2003 10:25 am 
Newbie

Joined: Wed Sep 17, 2003 8:26 am
Posts: 16
hi,

it looks like that did the trick. But I think I'll have to wait for the 'real test' tomorrow to confirm it.

thx,

jan


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.