-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: Sybase dialect : problem with "identity" when opti
PostPosted: Tue Dec 02, 2003 2:50 pm 
Beginner
Beginner

Joined: Tue Oct 07, 2003 11:36 am
Posts: 46
Location: Rennes, France
Hi all,

I have noticed and read on the URL below that two essential things in Sybase where incompatible:
- the identity feature, allowing to generate id automatically
- the "DYNAMIC PREPARE" option which enables the parsing & compilation of PreparedStatements (ultra mandatory to boost the execution of requests)

If those two settings are enabled with the jConnect 5.5 driver for Sybase, the result of the "select @@identity" request generated by Hibernate is always returning 0.
When disabling the DYNAMIC PREPARE flag, the result is the last inserted id.

Has anybody met the same problem ?
What are the right ways to solve it except changing the database ;-)

Yann


http://groups.google.fr/groups?hl=fr&lr=&ie=UTF-8&oe=UTF-8&threadm=38B06181.527412AA%40t-online.de&rnum=1&prev=/groups%3Fnum%3D100%26hl%3Dfr%26ie%3DUTF-8%26oe%3DUTF-8%26q%3D%2522select%2B%40%40identity%2522%2B%2522dynamic%2Bprepare%2522%26sa%3DN%26tab%3Dwg%26meta%3D


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 03, 2003 4:45 am 
Beginner
Beginner

Joined: Tue Oct 07, 2003 11:36 am
Posts: 46
Location: Rennes, France
Has anyone met similar problems ?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 03, 2003 12:31 pm 
Regular
Regular

Joined: Sat Oct 18, 2003 11:53 am
Posts: 55
Could you post the SQL to create your table?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 03, 2003 1:23 pm 
Beginner
Beginner

Joined: Tue Oct 07, 2003 11:36 am
Posts: 46
Location: Rennes, France
This may occur on nullable columns....

Code:
create table t_debiteur (
     id_debiteur          numeric                        identity,
     id_huissier          numeric                        null,
     id_civilite          numeric                        null,
     id_etat_debiteur     numeric                        null,
     id_departement       numeric                        null,
     id_echeancier        numeric                        null,
     id_mandataire        numeric                        null,
     id_pays              numeric                        null,
     nm_siret             varchar(14)                    null,
     nm_numero_pacage     varchar(18)                    null,
     fg_rco               numeric(1)                     null,
     lb_etat_rco          varchar(40)                    null,
     lb_nom               varchar(40)                    null,
     lb_prenom            varchar(40)                    null,
     lb_adresse_1         varchar(40)                    null,
     lb_adresse_2         varchar(40)                    null,
     lb_adresse_3         varchar(40)                    null,
     lb_adresse_4         varchar(40)                    null,
     cd_code_postal       varchar(5)                     null,
     lb_ville             varchar(40)                    null,
     lb_tel               varchar(16)                    null,
     lb_fax               varchar(16)                    null,
     lb_email             varchar(40)                    null,
     lb_rib               varchar(40)                    null,
     lb_banque            varchar(40)                    null,
     dt_naissance         datetime                       null,
     lb_lieu_naissance    varchar(40)                    null,
     dt_redressement_judiciaire datetime                       null,
     dt_liquidation_judiciaire datetime                       null,
     dt_mise_a_jour       datetime                       not null,
     constraint PK_T_DEBITEUR primary key (id_debiteur)
)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 03, 2003 1:30 pm 
Regular
Regular

Joined: Sat Oct 18, 2003 11:53 am
Posts: 55
yannraoul wrote:
This may occur on nullable columns....

Code:
create table t_debiteur (
     id_debiteur          numeric                        identity,
...
)



Have you tried:

id_debiteur numeric IDENTITY (1, 1) NOT NULL,


-matt


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 03, 2003 1:32 pm 
Beginner
Beginner

Joined: Tue Oct 07, 2003 11:36 am
Posts: 46
Location: Rennes, France
The problem does not occur on the id column but on "string" columns.
In fact, i suspect Sybase to use the "empty string" to represent the NULL value. So, the "empty string" value may be represented by one blank "space" value... :-(

Any idea ?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.