Re: Dods: Save reference object problem
Vladimir Puskas <[email protected]> 26 Dec 2003 15:29:27 -0100
| Newsgroups | gmane.comp.java.enhydra.dods |
|---|---|
| Organization | Together, Serbia |
| Message-ID | <[email protected]> |
On Fri, 2003-12-19 at 14:34, Zvonimir Radulovic wrote:
> Hi Dods,
>
> When I made changes on reference object attribute and save the object
> (parent object)
>
> DODS throws exception:
>
> . . . .
>
> Caused by: java.sql.SQLException: Invalid argument value: Duplicate
> entry '1000200' for key 1
> at org.gjt.mm.mysql.MysqlIO.sendCommand(MysqlIO.java:497)
> at org.gjt.mm.mysql.MysqlIO.sqlQueryDirect(MysqlIO.java:550)
> at org.gjt.mm.mysql.Connection.execSQL(Connection.java:885)
> at
> org.gjt.mm.mysql.PreparedStatement.executeUpdate(PreparedStatement.java:389)
> at
> com.lutris.appserver.server.sql.standard.StandardDBConnection.executeUpdate(Unknown Source)
> at
> com.lutris.appserver.server.sql.CoreDO.executeInsert(Unknown Source)
> at
> com.lutris.dods.builder.generator.dataobject.GenericDO.executeInsert(Unknown Source)
>
> . . . .
>
> DODS try to insert object instead of update it.
Method executeInsert(DBConnection) of CoreDO starts with
if (persistent) {
executeUpdate(conn);
} //...
and this should prevent any unnecessary insert statements (boolean field
persistent is true for DOs read from database).
Anyways I didn't understand how you get this, could you share some code
(rest of stack trace, context)?
> I made some changes in templates but I don't think that is OK. What
> can I do?
>
> Regards,
>
> Z. Radulovic
>
>
>
> ______________________________________________________________________
> Do you Yahoo!?
> New Yahoo! Photos - easier uploading and sharing
--
Vladimir Puskas <[email protected]>
Together, Serbia