cancel
Showing results for 
Search instead for 
Did you mean: 

Howto modify value of automatic generated primary key

Former Member
0 Kudos

Hi,

i'm using an "unknown" primary key in my CMP Entity Bean to automatically generate the primary key for the DB Table.

the table is not empty, so the new dataset with the generated primary key possibly cannot be written in the table.

is there any way to modify the start and end values for the generated primary key?

or is there any workaround for my problem?

any help is highly appreciated!

Michael

Accepted Solutions (0)

Answers (2)

Answers (2)

Vlado
Advisor
Advisor
0 Kudos

Hi Michael,

hi Stefan,

In the SAP Web AS 6.40 you cannot set the start number for a generated CMP primary key. However, the EJB Container internally checks the maximum value contained in the primary key column and starts CMP PK generation from the next number, i.e. if you had in the DB the values 1, 2, 3, 5, 8, for example, then the primary key of the first created CMP bean would be 9. But actually, the exact value inserted should not matter much to you - otherwise you should not be using unknown primary key and auto key generation.

If you experience any troubles with the above, please share your exact problem and the corresponding exception stacktrace. Please also specify which SP version you are using.

Best regards,

Vladimir

Former Member
0 Kudos

Hallo,

i've got the same problem.

i use Microsoft SQL Server as Database. does anyone know the tablename, where i can access the actual "next generated key"?

or is there another place, where the web AS put that key information?

regards,

Stefan