Hi Eric,
Jersey does not do anything with databases. Are you referring to
NetBeans generated code?
Could you describe the HTTP operation you performed and with what data?
Paul.
On Jan 20, 2009, at 7:01 PM, Marsh Eric wrote:
> Hello,
>
> I'm working on inserting a new record that was created remotely and
> then passed via RESTful services and inserted into a common
> database. Because of the record's remote creation it does not know
> what primary key will be used when it is inserted into the main
> database. The database itself will generate the primary key's value.
>
> The problem I'm experiencing is that when I pass a record to the
> local server without a primary key value being passed a null value
> is being generated for the primary key somewhere in the Jersey
> layers the system is attempting to insert it. This is causing the
> following exception:
>
> Local Exception Stack:
> Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build
> b09d-fcs (12/06/2007))):
> oracle.toplink.essentials.exceptions.DatabaseException
> Internal Exception: org.postgresql.util.PSQLException: ERROR: null
> value in column "pk" violates not-null constraint
> Error Code: 0
> Call: INSERT INTO mylocation (pk, accuracy, time, latitude, imat,
> longitude, bindatakey, mykey) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
> bind => [null, 17, null, 29.92574, null, -97.62597, null, 1]
> Query: InsertObjectQuery(hereiam.Mylocation[pk=null])
>
> How can I prevent the system from attempting to insert a null value
> (or for that matter any value) for the primary key? I've tried
> changing the @Column value to "insertable = false" but that hasn't
> worked.
>
> Thanks,
>
> Eric
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>