On Dec 15, 2006, at 11:36 AM, John Siracusa wrote:
> Since NOW() is evaluated server-side, the only way to know what it was
> actually set to is to reload that column from the db. As you noted,
> you can reload all columns as a workaround:
>
>> $roseObj->timestamp_action('NOW()');
>> $roseObject->save;
>> $roseObject->load;
>
> I'm not sure what the alternative might be. There's no getting around
> having to load those values from the db after save. Reloading just
> the columns that need to be reloaded could result in an inconsistent
> object. (In both cases, there's a race, but at least reloading
> everything always creates an internally consistent object.)
i'm not sure either.
i'm using the workaround, i'm fine with that.
i just wanted to bring up the general-case scenario for all columns
that are evaluated server side.
maybe in a perfect world, there could be a rose object that did this:
a- was aware if it were in a transaction
b- could have class metadata that notes if a column value is a
server side function
c- could realize that an operation would cause a new server-side
result (ie: a timestamp operation or multi-column explicit function
( cola = cola+colb ) )
d- would reload if the above conditions were met
its not a simple solution. i wouldn't expect rose to be able to
even handle anything like this for years - if ever.
i just wanted to bring up the scenarios for discussion
// Jonathan Vanasco
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
| FindMeOn.com - The cure for Multiple Web Personality Disorder
| Web Identity Management and 3D Social Networking
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
| RoadSound.com - Tools For Bands, Stuff For Fans
| Collaborative Online Management And Syndication Tools
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Rose-db-object mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rose-db-object