David Ware wrote:
Just an FYI for my ongoing DB2 journey. I'm past the SQL schema generation phase and onto the runtime bits.

I was/am having some trouble with saving objects. I eventually started putting some printlns into village to see what kind of sql it was doing.
They looked like:

 INSERT INTO <tablename> ( ) VALUES ( )

Turns out village doesn't persist columns unless the meta data it has stored for that column returns false on a Column.readOnly() call.
Unfortunately the way village collects this data is to go:

 SELECT <column1>, <column2> ... FROM <tablename> WHERE 1 = -1

And then use the values from the ResultSetMetaData. Now I'm not sure how JDBC Drivers are suppose to behave but the DB2 one that I'm using will return true for a ResultSetMetaData.isReadOnly() only if you did something like:
Sorry should be:
... will return *false* for a ResultSetMetaData.isReadOnly() only ...

 SELECT blah FROM foo FOR UPDATE

The upshot is I'm going through commenting out the readOnly() checks from Record.java as they appear to be largely useless for my purposes.

Cheers,
Dave Ware

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to