Hi Ricardo,
To use of Sequoia + Postgres + sequence you may have the follow problem that I discovery today:

When you make a insert that use sequence in Postgres, and the insert fail, the sequence increment will never rollback.
Than I discovery a problem with this scenario:

- I have a backend_1 and backend_2;
- Make a backup of backend_2 (the backend go to disabled state);
- Make a sequencial insert that will fail while backend_2 during the backup (the insert will execute only in backend_1, the sequence in the backend_1 will be incremented but the insert will not occurs); - The backup over, and backend_2 become enabled (the recovery log will replay the insertions and update that occurs during the backup, but will NOT replay the insertion that failed and increment the sequence in the backend_1); - So the sequence in the 2 backends are inconsistent, and in the next insertion the data will be different in the backends;

To workaround this problem you may use stored procedures to insert all the datas that use sequencial values, because even if the procedure fail it will be replayed by the recovery log.

I'm using the Sequoia, and don't know if this happens in the 2.x.

Leandro Borges

Ricardo Kustner escreveu:
Hi Emmanuel,

Emmanuel Cecchet wrote:
Hi Ricardo,
(I wrote this to the community list earlier, but I guess that's the wrong place?)
The community list is not read as widely as the Sequoia list. So for Sequoia related questions, please use the Sequoia mailing list.
I'd suggest the mailinglist page gets updated with some more information on the purpose of the community en sequoia list. The low traffic on the community could make it look as if there isn't much activity going on in the Sequoia community :)

We are using a Sequoia cluster with a hibernate based application in tomcat.

One thing which confuses me, is what the best way is to have the
application communicate with Sequoia:
A) let hibernate use the tomcat jdbc resource.. or...
B) have hibernate connect directly to Sequoia through jdbc? The reason I'm asking is that the sequoia docs talks about special tricks
to be used for using sequences properly
(http://sequoia.continuent.org/doc/2.10/userGuide/ar01s06.html, 6.6 and
6.7)
Would that work properly in situation (A) ?
The special tricks with sequences are related to PostgreSQL and they apply to all cases if the application uses sequences. If you use Hibernate to generate the database queries, it will use sequences with PostgreSQL. Thus, you will need the trick mentioned in the doc. If you are writing all SQL by hand and don't use PostgreSQL sequences then you don't need the trick.

Thanks for your answer. I guess the developers of the application we host will need to look into having their hibernate connect directly with Sequoia and use the sequence trick.


Ricardo.





_______________________________________________
Sequoia mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/sequoia



--
LEANDRO DE PAULA BORGES
Analista de Desenvolvimento de Software

PST Electronics
Phone: +55 19 3787 6402
[EMAIL PROTECTED]
www.pst.com.br
www.positron.com.br


_______________________________________________
Sequoia mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/sequoia

Reply via email to