cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrzej Jan Taramina" <andr...@chaeron.com>
Subject Re: Modular DB Actions, MS SQLServer and AutoIncrement columns? SOLVED
Date Fri, 17 Oct 2003 15:58:18 GMT
> I'm trying to figure out how to use MS SQLServer 2K's Identity columns as a
> primary key, which automatically generate a new value for the field when using
> Modular DB Actions to do an insert.
> 
> I kinda thought it should look like this for an identity column called "id" in
> the database descriptor:
> 
> <key name="id" type="int" autoincrement="true">
>  <mode name="auto" type="autoincr"/>
> </key>
> 
> But it didn't work.....the DatabasAddAction tried to insert the value for the
> actual key, and SQLServer punted that since you can't manually set identity
> columns.

Using the Manual AutoIncrement module was the source of the trouble when I 
had the key field set as an SQLServer Identity field.

So I wrote a quick SQLServer Identity AutoIncrement module for Cocoon that 
resolved this issue for me.  It's called 
org.apache.cocoon.components.modules.database.SQLServerIdentityAutoIncrementMo
dule
and was modelled on the hsqldb version that comes with Cocoon 2.1.2.

Maybe one of the developers would be interested in adding this for Cocoon 
2.1.3?

Yours for the asking if you want it.  ;-)


Andrzej Jan Taramina
Chaeron Corporation: Enterprise System Solutions
http://www.chaeron.com


Mime
View raw message