Sean Legassick wrote:
> 
> On Sat, Jun 17, 2000 at 07:50:42AM -0400, Nissim wrote:
> > This error is caused by the fact that manipulation of large object data
> > in Postgres must be done within a transaction.  Jon, how would you feel
> > about putting something like this in BasePeer.doUpdate:
> 
> We have the DB classes to handle database-specific requirements. You
> should look at how you can use them to achieve what you want - that way
> this kind of special case code has no impact on those not using
> Postgres.
> 
> --
> Sean Legassick

What if we added a method to the DB interface, boolean
binaryWriteNeedsTransaction() which returns true for postgresql and
false for all the other implementations, and then the code in BasePeer
will call a new private method to check if any of the columns in the
updateValues criteria are binary data, based on the types in the
databaseMap.  If any of the columns getType returned an object which
wasn't instanceof Number, String, or Date, we'd assume it was binary
data.

Then  in the BasePeer.doUpdate, if the updateValues contains binary
data, and the db.binaryWriteNeedsTransaction() we'll run the code for
begin tran and commit tran.

If this sounds OK to you guys I'll write it and send a patch.

        -Nissim


------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to