Hi,
> I just realized that this has only been mentioned in the 2.10 documentation. We're actually using 3.0beta... do you know if the sequence trick is also required for 3.0? Yes, this is also required in 3.0.
Actually, it looks as if it has been removed from the 3.0beta1 documentation (chapter 6.2.5). Or has the information only been added to the 2.10 documentation?

The new documentation for the 3.0 series explicitly says the following:

6.2.5  Hibernate configuration example
Define the Sequoia driver just as any other JDBC driver, leaving the syntax set to the proper database. Here is a configuration example of how to use Hibernate with a
        cluster made of PostgreSQL database backends.
## Sequoia
hibernate.dialect
net.sf.hibernate.dialect.PostgreSQLDialect
hibernate.connection.driver_class org.continuent.sequoia.driver.Driver
hibernate.connection.username              user
hibernate.connection.password              pass
hibernate.connection.url jdbc:sequoia://host1,host2/vdbname

Should this 3.0 documentation be incorrect could you then please show us a test situation in which the original HibernatePostgresqlDialect causes a problem so we can reproduce this?

This is our setup:
Application deployed in Tomcat 5.5.20
Using Hibernate
Sequoia 3.0beta2, two controllers
Postgresql 8.2.2

The first thing we tried was the trick as described in the Sequoia 2.10 manual at paragraph 6.7

package org.hibernate.dialect;
import org.hibernate.dialect.PostgreSQLDialect;
public class SEQUOIAPostgreSQLDialect extends PostgreSQLDialect {
    public String getSequenceNextValString(String sequenceName) {
         return "{call nextval('"+sequenceName+"')}";
   }
}

This caused the application to freeze once we started inserting alot of data (*). So we tried to see if it was a configuration error and replaced it with this

package org.hibernate.dialect;
import org.hibernate.dialect.PostgreSQLDialect;
public class SEQUOIAPostgreSQLDialect extends PostgreSQLDialect {
    public String getSequenceNextValString(String sequenceName) {
         System.out.println("---->>>>>> " + sequenceName + " hier");
        return super.getSequenceNextValString(sequenceName);
   }
}

This worked okay and never caused a freeze. We could see that the "new" SEQUOIAPostgreSQLDialect was used because we could see the --->>>>>> output in the logs. But this was obviously not fixed so we changed it back and the application freezed up again.

(*) even worse, the sequoia controllers weren't even responding anymore to sql commands on the prompt:
select * from sometable limit 10;
(...after a short pause...)
An error occured while executing SQL query (org.continuent.sequoia.common.exceptions.driver.DriverSQLException: Message of cause: Internal exception org.continuent.hedera.adapters.TimeoutException)
We had to shutdown/restart the controllers to make them work again.

Thanks in advance...

Ricardo.


Emmanuel Cecchet wrote:
Hi Ricardo,
Emmanuel Cecchet wrote:
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.

I just realized that this has only been mentioned in the 2.10 documentation. We're actually using 3.0beta... do you know if the sequence trick is also required for 3.0?
Yes, this is also required in 3.0.

Emmanuel



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

Reply via email to