> yeah SQLAlchemy started, like Rick was getting at, with a much "closer  
> to the metal" idea than that, that if you made a new object and put it  
> in the session, youd "know" that it wasnt flushed yet.  My experience  
> with hibernate is identical, actually, nothing gets generated or  
> anything in our environment over here until the flush happens.
> 
> But another thing, is that the whole idea of "save/update/save-or- 
> update", which we obviously got from hibernate, is something ive been  
> considering ditching, in favor of something more oriented towards a  
> "container" like add().  since i think even hibernate's original idea  
> of save/update has proven to be naive (for example, this is why they  
> had to implement saveOrUpdate()).  we like to keep things explicit as  
> much as possible since thats a central philosophical tenet of Python.

To be honest, I think a lot of people aren't thrilled with that aspect 
of Hibernate. Actually, I don't think I've ever used update() or 
saveOrUpdate(), since everything else seems "just work" (i.e. changes 
made to entities loaded from the DB get automatically saved when the 
transaction commits).

So back to my original thoughts regarding the ability to fetch 
db-generated primary keys (and other DefaultGenerator things) after a 
save() but before an explicit/implicit flush...

I would think it could be an option on the Table (err, Column) itself 
and not a mapper option. Something like pending_flush=True (which can 
default to False to keep the current behavior...though that name 
probably isn't very good, but flush_when_pending_on_read is too long ;).

Does that sound like a reasonable idea? You don't have to commit to any 
work if you don't want, I wouldn't mind trying my hand at it if necessary.

Thanks,

-Adam Batkin

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to