Hi Emmanuel

I did as you said, but now the controller throws an exception

Exception in thread "VirtualDatabaseWorkerThread-ITECBAN_DB"
java.lang.NullPointerException
       at 
org.continuent.sequoia.controller.requestmanager.RequestManager.openPersistentConnection(RequestManager.java:482)
       at 
org.continuent.sequoia.controller.virtualdatabase.VirtualDatabase.openPersistentConnection(VirtualDatabase.java:1043)
       at 
org.continuent.sequoia.controller.virtualdatabase.VirtualDatabaseWorkerThread.run(VirtualDatabaseWorkerThread.java:336)

when I call   getConnection
....
Class.forName("org.continuent.sequoia.driver.Driver");
String dbUrl = 
"jdbc:sequoia://aolias.indra.es/ITECBAN_DB?persistentConnection=true";
DriverManager.getConnection(dbUrl, user, password);



On 10/27/06, Emmanuel Cecchet <[EMAIL PROTECTED]> 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

--
Emmanuel Cecchet
Chief Architect, Continuent

Blog: http://emanux.blogspot.com/
Open source: http://www.continuent.org
Corporate: http://www.continuent.com
Skype: emmanuel_cecchet
Cell: +33 687 342 685



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

Reply via email to