db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carlos Chávez <ccha...@agssa.net>
Subject SECUENCE of PostgreSQL increment value if use QueryByIdentity and getObjectByQuery
Date Fri, 07 Jan 2005 00:32:59 GMT

 Hello to all.

 I found a strange behavior in OJB.

 Suppose that I have the table client, the value of the field cli_id is
 taken from a sequence, the table is in PostgreSQL, cli_id is the
 primarykey and is a integer.

 if I want to recover a client using QueryByIdentity and getObjectByQuery,
 I write the following code:

      Client c = new Client();
      c.setCli_id(id);
      Query query = new QueryByIdentity(c);
      Client N = (Client) pb.getObjectByQuery(query);

 If the var "id" has a "null" value, to execute this code make the
 value of the sequence is increased.

 Of course that would not be correct to send "id" null, but I believe that
 the sequence would not have affected by this.

 I believe that it is an indirect effect that would not have to happen.

 I am using db-ojb 1.0.0.

 I'm not sure if this behavior is happening in the other version.

 somebody could verify it?

 is a Bug o a Feature ? :)

 Cheers.

-- 
Carlos Chávez

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message