We faced that problem awhile ago. We run sequoia 2.10 with two DB's so what we decided to do was to setup one DB to issue an odd sequences and the other one even sequences. Whenever we start sequoia we make sure sequences are ok. We don't have that many sequences though.
Hope this help Julius > Date: Mon, 20 Jul 2009 11:37:46 -0400 > From: [email protected] > To: [email protected] > Subject: [Sequoia] [JIRA] Commented: (SEQUOIA-975) Insert statements fail > after 'call Nextval' in PostgreSQL cluster > > [ > https://forge.continuent.org/jira/browse/SEQUOIA-975?page=comments#action_15653 > ] > > Arnout Engelen commented on SEQUOIA-975: > ---------------------------------------- > > We can confirm this issue also appears on 2.10.10 on Linux. > > The workaround above works, but this is a rather subtle and nasty bug - it'd > be great if this could be fixed at the sequoia level. All queries that modify > sequences as a side-effect should be treated like inserts/updates and be sent > to all backing databases. > > > Insert statements fail after 'call Nextval' in PostgreSQL cluster > > ----------------------------------------------------------------- > > > > Key: SEQUOIA-975 > > URL: https://forge.continuent.org/jira/browse/SEQUOIA-975 > > Project: Sequoia > > Type: Bug > > > Components: Core > > Versions: Sequoia 2.10.9 > > Environment: Windows, Hibernate, PostgreSQL and Spring > > Reporter: Love Singhal > > > > > > > I am currently facing this issue and is a blocker for me. > > I have a Spring and Hibernate based Java server which is connected to > > PostgreSQL database. I want to add database clustering to it using sequoia. > > The server uses sequences to generate various Ids. One sequence > > 'hibernate_sequence' is automatically used by the Hibernate framework. > > I installed a sequoia cluster of two databases with two controllers. To > > enable synchronization of sequences, I changed the sql query 'select > > nextval' to '{call nextval.. }' as mentioned in the documents. For > > hibernate, I defined the new SQL dialect which changes the nextVal query > > string. > > However, I am finding that the database statements that do an insert > > statement along with the 'call nextval' statement in the same transaction > > fail consistently. The error returned in the logs and to the server is: > > > uncategorized SQLException for SQL [insert into category (name, > > > description, prefix, server_path, category_id) values (?, ?, ?, ?, ?)]; > > > SQL state [null]; error code [0]; Batch failed for request 0: insert into > > > category (name, description, prefix, server_path, category_id) values (?, > > > ?, ?, ?, ?) > > > (org.continuent.sequoia.common.exceptions.driver.DriverSQLException: > > > Message of cause: write request 562949953421404 failed: > > Backend ras - BackendWorkerThread for backend 'localhost2' with RAIDb > > level:1 failed (ERROR: current transaction is aborted, commands ignored > > until end of transaction block) > > The ras is the name of the virtual database. > > All kinds of insert requests (not necessarily, in the category table) are > > failing when they are called along with the call nextval statement. The > > call nextval statement always succeeds. The error is also same for all > > kinds of inserts. Everytime, backend localhost2 has some problem. I tried > > to locate the cause of the problem in the logs but could not find anything > > that specifies the cause (even after setting up everything to DEBUG log > > level). I cant do a '{call nextval}' in a separate transaction as these > > calls are automatically made by hibernate. > > When I revert back the '{call nextval' statement to 'select nextval', > > things work fine until some primary key gets duplicated (sequences in the > > two databases become unequal). Also, the update calls along with '{call > > nextval' seem to succeed. > > I am now stuck with this issue and could not proceed any further with > > clustering. Please help. > > -- > This message is automatically generated by JIRA. > - > If you think it was sent incorrectly contact one of the administrators: > https://forge.continuent.org/jira/secure/Administrators.jspa > - > For more information on JIRA, see: > http://www.atlassian.com/software/jira > > _______________________________________________ > Sequoia mailing list > [email protected] > http://forge.continuent.org/mailman/listinfo/sequoia
_______________________________________________ Sequoia mailing list [email protected] http://forge.continuent.org/mailman/listinfo/sequoia
