On Jul 11, 2008, at 10:45 AM, Ryan Parrish wrote:

>
> On Jul 11, 10:03 am, Michael Bayer <[EMAIL PROTECTED]> wrote:.
>>
>> The reason you're getting the disconnect exception in the first place
>> is because the pool_recycle feature only works upon checkout from the
>> pool.  So the solution is the same, ensure all connections are
>> returned to the pool after operations are complete.
>
> So if i just setup sessionmaker(autoflush=True, transactional=False,
> bind=engine) rather than transactional=True which it is now; I would
> never have these implicit begin()'s started which are pointless since
> I'm only doing selects on the DB?  Thus my problem would be solved?

using transactional=False is one solution, but a better one is to  
simply rollback(), commit(), or close() the Session when operations  
are complete - transactional mode (which is called "autocommit=False"  
in 0.5) has the advantage that a series of select operations will all  
share the same isolated transactional context..this can be more or  
less important depending on the isolation mode in effect and the kind  
of application.

DBAPI has no implicit "autocommit" mode so there is always a  
transaction implicitly in progress when queries are made.


--~--~---------~--~----~------------~-------~--~----~
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