I have a model on a single postgres database that is used by two processes. using the following code code I am getting duplicate keys(an exception is being thrown) for Event when Events are created by the two processes.
Does your default key generator not uses sequences. I am using your do40test database generated by the samples for testing my simple application and assumed because it created a Int64-Generator sequence it would use this. Tony Updated at 11.11.2009 16:16:36If required I can send you the vs2008 solution zipped. Updated at 11.11.2009 16:52:27will send, the exception is: {"ERROR: 23505: duplicate key value violates unique constraint \"PK_Event\""} "INSERT INTO \"public\".\"Event\" (\"Id\", \"TypeId\", \"ApplicationName\", \"Topic.Id\", \"args\") VALUES (12, 101, 'App2', 1, '\\000\\001\\000\\000\\000\\377\\377\\377\\377\\001\\000\\000\\000\\000\\000\\000\\000\\004\\001\\000\\000\\000\\020\\123\\171\\163\\164\\145\\155\\056\\105\\166\\145\\156\\164\\101\\162\\147\\163\\000\\000\\000\\000\\013')" at Npgsql.NpgsqlConnector.CheckErrors() at Npgsql.NpgsqlConnector.CheckErrorsAndNotifications() at Npgsql.NpgsqlCommand.ExecuteCommand() at Npgsql.NpgsqlCommand.ExecuteNonQuery() at Xtensive.Storage.Providers.Sql.Driver.ExecuteNonQuery(Session session, DbCommand command) in c:\TeamCity\buildAgent\work\6a5d81309423096e\Xtensive.Storage\Xtensive.Storage.Providers.Sql\Driver.Operations.cs:line 108 Updated at 11.11.2009 22:22:30Not using TeamCity, never heard of it until your post. Ok you have triggered a thought, I duplicated the process from the first process and may have left it set to recreate the domain, hence hence the problem with duplicate and cached keys. Code is at work, will check tomorrow, but suspect its my fault. Sorry for wasting your time. Tony This thread was imported from our support forum. The original discussion may contain more detailed answer. |
Hello Tony,
Default key generator for PostgreSql must definitely use appropriate sequence. I'm going to investigate this issue asap.
Yes. please. Send it to support@x-tensive.com.
Thanks