db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Ware <da...@reeltwo.com>
Subject Re: Fun village behavior
Date Mon, 21 Apr 2008 03:16:46 GMT
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: torque-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-dev-help@db.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message