FAQ
Incorrect generation of primary key values
------------------------------------------

Key: CAY-997
URL: https://issues.apache.org/cayenne/browse/CAY-997
Project: Cayenne
Issue Type: Bug
Components: Cayenne Core Library
Affects Versions: 3.0
Environment: postgres 8.2
Reporter: Rares Ispas
Assignee: Andrus Adamchik
Priority: Blocker


Fast creation of rows results in Cayenne attempting to reuse the same pk:

public void testVideoFiles()
{
for( int i = 0; i < 200; i++ )
VideoFilesDb.insert( 7l, "asdasd", new Date(), new Date(), new Date(), VideoFilesDb.RetentionPolicy.SpaceRequired, new Date(), "" );
}


public static void insert( long videoStreamId, String fileName, Date startTime, Date endTime, Date uploadTime, RetentionPolicy retentionPolicy, Date retentionExpiration, String hash )
{
DataContext ctx = DataContext.createDataContext();
VideoFiles vf = (VideoFiles) ctx.newObject( VideoFiles.class );
vf.setVideoStreamId( videoStreamId );
vf.setFileName(fileName);
vf.setStartTime(startTime);
vf.setEndTime(endTime);
vf.setUploadTime(uploadTime);
vf.setRetentionPolicy( retentionPolicy.toString() );
vf.setRetentionExpiration( retentionExpiration );
vf.setHash(hash);

ctx.commitChanges();
}

results in exception:
org.postgresql.util.PSQLException: ERROR: duplicate key violates unique constraint "VideoFiles_pkey"
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1559)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1327)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:352)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2596)
at org.apache.cayenne.access.jdbc.BatchAction.runAsBatch(BatchAction.java:134)
at org.apache.cayenne.access.jdbc.BatchAction.performAction(BatchAction.java:81)
at org.apache.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQueryAction.java:58)
at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:230)
at org.apache.cayenne.access.DataDomainFlushAction.runQueries(DataDomainFlushAction.java:227)
at org.apache.cayenne.access.DataDomainFlushAction.flush(DataDomainFlushAction.java:145)
at org.apache.cayenne.access.DataDomain.onSyncFlush(DataDomain.java:821)
at org.apache.cayenne.access.DataDomain$2.transform(DataDomain.java:788)
at org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:847)
at org.apache.cayenne.access.DataDomain.onSync(DataDomain.java:785)
at org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:1175)
at org.apache.cayenne.access.DataContext.commitChanges(DataContext.java:1088)
at ScreenRecorder.db.VideoFilesDb.insert(VideoFilesDb.java:38)
at ScreenRecorder.DbTests.testVideoFiles(DbTests.java:17)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:164)
at junit.framework.TestCase.runBare(TestCase.java:130)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:120)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at junit.framework.TestSuite.run(TestSuite.java:225)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:421)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:912)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:766)

Here is the entity:

<db-entity name="video_files" schema="screen_recorder0_5">
<db-attribute name="end_time" type="TIMESTAMP" length="29"/>
<db-attribute name="file_name" type="VARCHAR" isMandatory="true" length="2147483647"/>
<db-attribute name="file_size" type="BIGINT" length="19"/>
<db-attribute name="hash" type="VARCHAR" length="2147483647"/>
<db-attribute name="id" type="BIGINT" isPrimaryKey="true" isMandatory="true" length="19"/>
<db-attribute name="retention_expiration" type="TIMESTAMP" length="29"/>
<db-attribute name="retention_policy" type="VARCHAR" isMandatory="true" length="2147483647"/>
<db-attribute name="start_time" type="TIMESTAMP" length="29"/>
<db-attribute name="upload_time" type="TIMESTAMP" length="29"/>
<db-attribute name="video_stream_id" type="BIGINT" isMandatory="true" length="19"/>
</db-entity>

Here is the trace. Please remark that selecting from sequence only occurs a few times, after that Cayenne attempts to internally increment the id. That's very wrong.

Mar 4, 2008 6:58:19 PM org.apache.cayenne.conf.RuntimeLoadDelegate startedLoading
INFO: started configuration loading.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.conf.RuntimeLoadDelegate shouldLoadDataDomain
INFO: loaded domain: ScreenRecorderDomain
Mar 4, 2008 6:58:19 PM org.apache.cayenne.conf.RuntimeLoadDelegate loadDataMap
INFO: loaded <map name='ScreenRecorderMap' location='ScreenRecorderMap.map.xml'>.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.conf.RuntimeLoadDelegate shouldLoadDataNode
INFO: loading <node name='ScreenRecorderDomainNode' datasource='ScreenRecorderDomainNode.driver.xml' factory='org.apache.cayenne.conf.DriverDataSourceFactory'>.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.conf.RuntimeLoadDelegate shouldLoadDataNode
INFO: using factory: org.apache.cayenne.conf.DriverDataSourceFactory
Mar 4, 2008 6:58:19 PM org.apache.cayenne.conf.DriverDataSourceFactory load
INFO: loading driver information from 'ScreenRecorderDomainNode.driver.xml'.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.conf.DriverDataSourceFactory$DriverHandler init
INFO: loading driver org.postgresql.Driver
Mar 4, 2008 6:58:19 PM org.apache.cayenne.conf.DriverDataSourceFactory$LoginHandler init
INFO: loading user name and password.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logPoolCreated
INFO: Created connection pool: jdbc:postgresql://10.1.0.2:5432/postgres
Driver class: org.postgresql.Driver
Min. connections in the pool: 1
Max. connections in the pool: 1
Mar 4, 2008 6:58:19 PM org.apache.cayenne.conf.RuntimeLoadDelegate shouldLoadDataNode
INFO: loaded datasource.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.conf.RuntimeLoadDelegate initAdapter
INFO: no adapter set, using automatic adapter.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.conf.RuntimeLoadDelegate shouldLinkDataMap
INFO: loaded map-ref: ScreenRecorderMap.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.conf.RuntimeLoadDelegate finishedLoading
INFO: finished configuration loading in 125 ms.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logConnect
INFO: Opening connection: jdbc:postgresql://10.1.0.2:5432/postgres
Login: postgres
Password: *******
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logConnectSuccess
INFO: +++ Connecting: SUCCESS.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logBeginTransaction
INFO: --- transaction started.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger log
INFO: Detected and installed adapter: org.apache.cayenne.dba.postgres.PostgresAdapter
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logQuery
INFO: SELECT nextval('screen_recorder0_5.pk_video_files')
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logQueryStart
INFO: --- will run 1 query.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logQuery
INFO: INSERT INTO screen_recorder0_5.video_files (end_time, file_name, file_size, hash, id, retention_expiration, retention_policy, start_time, upload_time, video_stream_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [batch bind: 1->end_time:'2008-03-04 18:58:19.608', 2->file_name:'asdasd', 3->file_size:NULL, 4->hash:'', 5->id:216, 6->retention_expiration:'2008-03-04 18:58:19.608', 7->retention_policy:'SpaceRequired', 8->start_time:'2008-03-04 18:58:19.608', 9->upload_time:'2008-03-04 18:58:19.608', 10->video_stream_id:7]
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logCommitTransaction
INFO: +++ transaction committed.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logQueryStart
INFO: --- will run 1 query.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logBeginTransaction
INFO: --- transaction started.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logQuery
INFO: INSERT INTO screen_recorder0_5.video_files (end_time, file_name, file_size, hash, id, retention_expiration, retention_policy, start_time, upload_time, video_stream_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [batch bind: 1->end_time:'2008-03-04 18:58:19.967', 2->file_name:'asdasd', 3->file_size:NULL, 4->hash:'', 5->id:217, 6->retention_expiration:'2008-03-04 18:58:19.967', 7->retention_policy:'SpaceRequired', 8->start_time:'2008-03-04 18:58:19.967', 9->upload_time:'2008-03-04 18:58:19.967', 10->video_stream_id:7]
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logCommitTransaction
INFO: +++ transaction committed.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logQueryStart
INFO: --- will run 1 query.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logBeginTransaction
INFO: --- transaction started.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logQuery
INFO: INSERT INTO screen_recorder0_5.video_files (end_time, file_name, file_size, hash, id, retention_expiration, retention_policy, start_time, upload_time, video_stream_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [batch bind: 1->end_time:'2008-03-04 18:58:19.983', 2->file_name:'asdasd', 3->file_size:NULL, 4->hash:'', 5->id:218, 6->retention_expiration:'2008-03-04 18:58:19.983', 7->retention_policy:'SpaceRequired', 8->start_time:'2008-03-04 18:58:19.983', 9->upload_time:'2008-03-04 18:58:19.983', 10->video_stream_id:7]
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logCommitTransaction
INFO: +++ transaction committed.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logQueryStart
INFO: --- will run 1 query.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logBeginTransaction
INFO: --- transaction started.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logQuery
INFO: INSERT INTO screen_recorder0_5.video_files (end_time, file_name, file_size, hash, id, retention_expiration, retention_policy, start_time, upload_time, video_stream_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [batch bind: 1->end_time:'2008-03-04 18:58:19.983', 2->file_name:'asdasd', 3->file_size:NULL, 4->hash:'', 5->id:219, 6->retention_expiration:'2008-03-04 18:58:19.983', 7->retention_policy:'SpaceRequired', 8->start_time:'2008-03-04 18:58:19.983', 9->upload_time:'2008-03-04 18:58:19.983', 10->video_stream_id:7]
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logCommitTransaction
INFO: +++ transaction committed.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logQueryStart
INFO: --- will run 1 query.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logBeginTransaction
INFO: --- transaction started.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logQuery
INFO: INSERT INTO screen_recorder0_5.video_files (end_time, file_name, file_size, hash, id, retention_expiration, retention_policy, start_time, upload_time, video_stream_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [batch bind: 1->end_time:'2008-03-04 18:58:19.983', 2->file_name:'asdasd', 3->file_size:NULL, 4->hash:'', 5->id:220, 6->retention_expiration:'2008-03-04 18:58:19.983', 7->retention_policy:'SpaceRequired', 8->start_time:'2008-03-04 18:58:19.983', 9->upload_time:'2008-03-04 18:58:19.983', 10->video_stream_id:7]
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logCommitTransaction
INFO: +++ transaction committed.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logQueryStart
INFO: --- will run 1 query.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logBeginTransaction
INFO: --- transaction started.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logQuery
INFO: INSERT INTO screen_recorder0_5.video_files (end_time, file_name, file_size, hash, id, retention_expiration, retention_policy, start_time, upload_time, video_stream_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [batch bind: 1->end_time:'2008-03-04 18:58:19.983', 2->file_name:'asdasd', 3->file_size:NULL, 4->hash:'', 5->id:221, 6->retention_expiration:'2008-03-04 18:58:19.983', 7->retention_policy:'SpaceRequired', 8->start_time:'2008-03-04 18:58:19.983', 9->upload_time:'2008-03-04 18:58:19.983', 10->video_stream_id:7]
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logCommitTransaction
INFO: +++ transaction committed.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logQueryStart
INFO: --- will run 1 query.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logBeginTransaction
INFO: --- transaction started.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logQuery
INFO: INSERT INTO screen_recorder0_5.video_files (end_time, file_name, file_size, hash, id, retention_expiration, retention_policy, start_time, upload_time, video_stream_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [batch bind: 1->end_time:'2008-03-04 18:58:19.999', 2->file_name:'asdasd', 3->file_size:NULL, 4->hash:'', 5->id:222, 6->retention_expiration:'2008-03-04 18:58:19.999', 7->retention_policy:'SpaceRequired', 8->start_time:'2008-03-04 18:58:19.999', 9->upload_time:'2008-03-04 18:58:19.999', 10->video_stream_id:7]
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logCommitTransaction
INFO: +++ transaction committed.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logQueryStart
INFO: --- will run 1 query.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logBeginTransaction
INFO: --- transaction started.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logQuery
INFO: INSERT INTO screen_recorder0_5.video_files (end_time, file_name, file_size, hash, id, retention_expiration, retention_policy, start_time, upload_time, video_stream_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [batch bind: 1->end_time:'2008-03-04 18:58:19.999', 2->file_name:'asdasd', 3->file_size:NULL, 4->hash:'', 5->id:223, 6->retention_expiration:'2008-03-04 18:58:19.999', 7->retention_policy:'SpaceRequired', 8->start_time:'2008-03-04 18:58:19.999', 9->upload_time:'2008-03-04 18:58:19.999', 10->video_stream_id:7]
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logCommitTransaction
INFO: +++ transaction committed.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logQueryStart
INFO: --- will run 1 query.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logBeginTransaction
INFO: --- transaction started.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logQuery
INFO: INSERT INTO screen_recorder0_5.video_files (end_time, file_name, file_size, hash, id, retention_expiration, retention_policy, start_time, upload_time, video_stream_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [batch bind: 1->end_time:'2008-03-04 18:58:19.999', 2->file_name:'asdasd', 3->file_size:NULL, 4->hash:'', 5->id:224, 6->retention_expiration:'2008-03-04 18:58:19.999', 7->retention_policy:'SpaceRequired', 8->start_time:'2008-03-04 18:58:19.999', 9->upload_time:'2008-03-04 18:58:19.999', 10->video_stream_id:7]
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logCommitTransaction
INFO: +++ transaction committed.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logQueryStart
INFO: --- will run 1 query.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logBeginTransaction
INFO: --- transaction started.
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logQuery
INFO: INSERT INTO screen_recorder0_5.video_files (end_time, file_name, file_size, hash, id, retention_expiration, retention_policy, start_time, upload_time, video_stream_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [batch bind: 1->end_time:'2008-03-04 18:58:19.999', 2->file_name:'asdasd', 3->file_size:NULL, 4->hash:'', 5->id:225, 6->retention_expiration:'2008-03-04 18:58:19.999', 7->retention_policy:'SpaceRequired', 8->start_time:'2008-03-04 18:58:19.999', 9->upload_time:'2008-03-04 18:58:19.999', 10->video_stream_id:7]
Mar 4, 2008 6:58:19 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logCommitTransaction
INFO: +++ transaction committed.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logQueryStart
INFO: --- will run 1 query.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logBeginTransaction
INFO: --- transaction started.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logQuery
INFO: INSERT INTO screen_recorder0_5.video_files (end_time, file_name, file_size, hash, id, retention_expiration, retention_policy, start_time, upload_time, video_stream_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [batch bind: 1->end_time:'2008-03-04 18:58:20.014', 2->file_name:'asdasd', 3->file_size:NULL, 4->hash:'', 5->id:226, 6->retention_expiration:'2008-03-04 18:58:20.014', 7->retention_policy:'SpaceRequired', 8->start_time:'2008-03-04 18:58:20.014', 9->upload_time:'2008-03-04 18:58:20.014', 10->video_stream_id:7]
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logCommitTransaction
INFO: +++ transaction committed.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logQueryStart
INFO: --- will run 1 query.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logBeginTransaction
INFO: --- transaction started.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logQuery
INFO: INSERT INTO screen_recorder0_5.video_files (end_time, file_name, file_size, hash, id, retention_expiration, retention_policy, start_time, upload_time, video_stream_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [batch bind: 1->end_time:'2008-03-04 18:58:20.014', 2->file_name:'asdasd', 3->file_size:NULL, 4->hash:'', 5->id:227, 6->retention_expiration:'2008-03-04 18:58:20.014', 7->retention_policy:'SpaceRequired', 8->start_time:'2008-03-04 18:58:20.014', 9->upload_time:'2008-03-04 18:58:20.014', 10->video_stream_id:7]
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logCommitTransaction
INFO: +++ transaction committed.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logQueryStart
INFO: --- will run 1 query.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logBeginTransaction
INFO: --- transaction started.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logQuery
INFO: INSERT INTO screen_recorder0_5.video_files (end_time, file_name, file_size, hash, id, retention_expiration, retention_policy, start_time, upload_time, video_stream_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [batch bind: 1->end_time:'2008-03-04 18:58:20.014', 2->file_name:'asdasd', 3->file_size:NULL, 4->hash:'', 5->id:228, 6->retention_expiration:'2008-03-04 18:58:20.014', 7->retention_policy:'SpaceRequired', 8->start_time:'2008-03-04 18:58:20.014', 9->upload_time:'2008-03-04 18:58:20.014', 10->video_stream_id:7]
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logCommitTransaction
INFO: +++ transaction committed.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logQueryStart
INFO: --- will run 1 query.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logBeginTransaction
INFO: --- transaction started.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logQuery
INFO: INSERT INTO screen_recorder0_5.video_files (end_time, file_name, file_size, hash, id, retention_expiration, retention_policy, start_time, upload_time, video_stream_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [batch bind: 1->end_time:'2008-03-04 18:58:20.014', 2->file_name:'asdasd', 3->file_size:NULL, 4->hash:'', 5->id:229, 6->retention_expiration:'2008-03-04 18:58:20.014', 7->retention_policy:'SpaceRequired', 8->start_time:'2008-03-04 18:58:20.014', 9->upload_time:'2008-03-04 18:58:20.014', 10->video_stream_id:7]
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logCommitTransaction
INFO: +++ transaction committed.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logQueryStart
INFO: --- will run 1 query.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logBeginTransaction
INFO: --- transaction started.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logQuery
INFO: INSERT INTO screen_recorder0_5.video_files (end_time, file_name, file_size, hash, id, retention_expiration, retention_policy, start_time, upload_time, video_stream_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [batch bind: 1->end_time:'2008-03-04 18:58:20.014', 2->file_name:'asdasd', 3->file_size:NULL, 4->hash:'', 5->id:230, 6->retention_expiration:'2008-03-04 18:58:20.014', 7->retention_policy:'SpaceRequired', 8->start_time:'2008-03-04 18:58:20.014', 9->upload_time:'2008-03-04 18:58:20.014', 10->video_stream_id:7]
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logCommitTransaction
INFO: +++ transaction committed.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logQueryStart
INFO: --- will run 1 query.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logBeginTransaction
INFO: --- transaction started.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logQuery
INFO: INSERT INTO screen_recorder0_5.video_files (end_time, file_name, file_size, hash, id, retention_expiration, retention_policy, start_time, upload_time, video_stream_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [batch bind: 1->end_time:'2008-03-04 18:58:20.014', 2->file_name:'asdasd', 3->file_size:NULL, 4->hash:'', 5->id:231, 6->retention_expiration:'2008-03-04 18:58:20.014', 7->retention_policy:'SpaceRequired', 8->start_time:'2008-03-04 18:58:20.014', 9->upload_time:'2008-03-04 18:58:20.014', 10->video_stream_id:7]
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logCommitTransaction
INFO: +++ transaction committed.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logQueryStart
INFO: --- will run 1 query.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logBeginTransaction
INFO: --- transaction started.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logQuery
INFO: INSERT INTO screen_recorder0_5.video_files (end_time, file_name, file_size, hash, id, retention_expiration, retention_policy, start_time, upload_time, video_stream_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [batch bind: 1->end_time:'2008-03-04 18:58:20.03', 2->file_name:'asdasd', 3->file_size:NULL, 4->hash:'', 5->id:232, 6->retention_expiration:'2008-03-04 18:58:20.03', 7->retention_policy:'SpaceRequired', 8->start_time:'2008-03-04 18:58:20.03', 9->upload_time:'2008-03-04 18:58:20.03', 10->video_stream_id:7]
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logCommitTransaction
INFO: +++ transaction committed.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logQueryStart
INFO: --- will run 1 query.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logBeginTransaction
INFO: --- transaction started.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logQuery
INFO: INSERT INTO screen_recorder0_5.video_files (end_time, file_name, file_size, hash, id, retention_expiration, retention_policy, start_time, upload_time, video_stream_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [batch bind: 1->end_time:'2008-03-04 18:58:20.03', 2->file_name:'asdasd', 3->file_size:NULL, 4->hash:'', 5->id:233, 6->retention_expiration:'2008-03-04 18:58:20.03', 7->retention_policy:'SpaceRequired', 8->start_time:'2008-03-04 18:58:20.03', 9->upload_time:'2008-03-04 18:58:20.03', 10->video_stream_id:7]
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logCommitTransaction
INFO: +++ transaction committed.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logQueryStart
INFO: --- will run 1 query.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logBeginTransaction
INFO: --- transaction started.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logQuery
INFO: INSERT INTO screen_recorder0_5.video_files (end_time, file_name, file_size, hash, id, retention_expiration, retention_policy, start_time, upload_time, video_stream_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [batch bind: 1->end_time:'2008-03-04 18:58:20.03', 2->file_name:'asdasd', 3->file_size:NULL, 4->hash:'', 5->id:234, 6->retention_expiration:'2008-03-04 18:58:20.03', 7->retention_policy:'SpaceRequired', 8->start_time:'2008-03-04 18:58:20.03', 9->upload_time:'2008-03-04 18:58:20.03', 10->video_stream_id:7]
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logCommitTransaction
INFO: +++ transaction committed.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logQueryStart
INFO: --- will run 1 query.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logBeginTransaction
INFO: --- transaction started.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logQuery
INFO: INSERT INTO screen_recorder0_5.video_files (end_time, file_name, file_size, hash, id, retention_expiration, retention_policy, start_time, upload_time, video_stream_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [batch bind: 1->end_time:'2008-03-04 18:58:20.03', 2->file_name:'asdasd', 3->file_size:NULL, 4->hash:'', 5->id:235, 6->retention_expiration:'2008-03-04 18:58:20.03', 7->retention_policy:'SpaceRequired', 8->start_time:'2008-03-04 18:58:20.03', 9->upload_time:'2008-03-04 18:58:20.03', 10->video_stream_id:7]
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logUpdateCount
INFO: === updated 1 row.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logCommitTransaction
INFO: +++ transaction committed.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logBeginTransaction
INFO: --- transaction started.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logQuery
INFO: SELECT nextval('screen_recorder0_5.pk_video_files')
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logQueryStart
INFO: --- will run 1 query.
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logQuery
INFO: INSERT INTO screen_recorder0_5.video_files (end_time, file_name, file_size, hash, id, retention_expiration, retention_policy, start_time, upload_time, video_stream_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logQueryParameters
INFO: [batch bind: 1->end_time:'2008-03-04 18:58:20.03', 2->file_name:'asdasd', 3->file_size:NULL, 4->hash:'', 5->id:217, 6->retention_expiration:'2008-03-04 18:58:20.03', 7->retention_policy:'SpaceRequired', 8->start_time:'2008-03-04 18:58:20.03', 9->upload_time:'2008-03-04 18:58:20.03', 10->video_stream_id:7]
Mar 4, 2008 6:58:20 PM org.apache.cayenne.access.QueryLogger logQueryError
INFO: *** error.
org.postgresql.util.PSQLException: ERROR: duplicate key violates unique constraint "VideoFiles_pkey"
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1559)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1327)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:352)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2596)
at org.apache.cayenne.access.jdbc.BatchAction.runAsBatch(BatchAction.java:134)
at org.apache.cayenne.access.jdbc.BatchAction.performAction(BatchAction.java:81)
at org.apache.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQueryAction.java:58)
at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:230)
at org.apache.cayenne.access.DataDomainFlushAction.runQueries(DataDomainFlushAction.java:227)
at org.apache.cayenne.access.DataDomainFlushAction.flush(DataDomainFlushAction.java:145)
at org.apache.cayenne.access.DataDomain.onSyncFlush(DataDomain.java:821)
at org.apache.cayenne.access.DataDomain$2.transform(DataDomain.java:788)
at org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:847)
at org.apache.cayenne.access.DataDomain.onSync(DataDomain.java:785)
at org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:1175)
at org.apache.cayenne.access.DataContext.commitChanges(DataContext.java:1088)
at ScreenRecorder.db.VideoFilesDb.insert(VideoFilesDb.java:38)
at ScreenRecorder.DbTests.testVideoFiles(DbTests.java:17)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:164)
at junit.framework.TestCase.runBare(TestCase.java:130)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:120)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at junit.framework.TestSuite.run(TestSuite.java:225)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:421)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:912)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:766)





--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdev @
categoriescayenne
postedMar 4, '08 at 5:11p
activeMar 4, '08 at 5:11p
posts1
users1
websitecayenne.apache.org

1 user in discussion

Anonymous: 1 post

People

Translate

site design / logo © 2021 Grokbase