Emmanuel,

I know that I have a problem with this call using postgres, (which I haven't got as far as looking at yet). Does the persistenceConnection described here apply to postgresql?

Also, reference hibernate with postgres, I have a drop constraint times 90, drop table times 50, create table times 50 and add constraint times 90 series which can take 10-12 seconds to execute per instruction on a dual opteron box. I have tried the useStoredProcedures = "false" attribute to no effect. Any pointers would be appreciated. I'm using cvs head, raidb1 configuration with a single backend.

Many thanks,

Peter

Emmanuel Cecchet wrote:
Alfonso,

I have a problem while inserting a new element into the DB.
I am using Sequoia controller (2.10.1). The application works fine
just using Hibernate - MySql. But when I use C-JDBC there is a problem
while getting the next sequence value.

I have also created this class as is said in the tutorial for
Postgres, but the error persists.

import org.hibernate.dialect.MySQLDialect;

public class SEQUOIAMySQLDialect extends MySQLDialect {
    public String getSequenceNextValString(String sequenceName){
        return "{call nextval('"+sequenceName+"')}";
    }
}

This will not work with MySQL, this is specific to PostgreSQL. You should use the standard Hibernate MySQL dialect with Sequoia. However, you must enable persistent connection in order for Hibernate to properly generate ids. This is done by adding ?persistentConnection=true to your Sequoia JDBC URL. Example: jdbc:sequoia://controller1,controller2/mydb?persistentConnection=true

You can find a description of all drivers option in the documentation at http://sequoia.continuent.org/doc/infocenter/topic/org.continuent.sequoia.doc/html/Sequoia_URL_options.html#95683056_pgfId-999057

Thanks for your feedback,
Emmanuel


--
------------------------------
Peter Courcoux
Telephone : +44 (0)1923 661488
Mobile    : 07880 605626
email     : [EMAIL PROTECTED]

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

Reply via email to