what a drag.

this has some inconvenient effects on ResultProxy.

while __del__ will still be there and im pretty confident works just fine
in cPython, if you dont want to rely upon __del__ you will basically have
to do:

   r = table.select().execute()
   for row in r:
      ....
   r.close()

doing a "close" automatically at the end of the iteration isnt going to
work since the returned RowProxy is also bound to the underlying Cursor.

similarly, if you do a CRUD operation, the returned ResultProxy has a
handle on the Cursor.  so which would you prefer, that the ResultProxy
doesnt have the resulting Cursor on it ?  or that you have to say:

    r = table.update().execute(foo='bar')
    r.close()

?

of course if you are using the upcoming style of explicit connection,
which will be:

    table.update.using(conn).execute(foo='bar')

  or

    conn.execute(table.update(), foo='bar')

then you just close the connection.

Also lots of areas throughout engine() will have to be recoded internally
to use explicit connections, closing them when ResultProxy objects are not
returned.

feel free to comment on ticket #152.

Brad Clements wrote:
> On 7 Apr 2006 at 19:00, Michael Bayer wrote:
>
>> the moral of the story is, if "del object" takes the reference count
>> down to zero, but Jython is still not going to call __del__ despite
>> this, then the connection pooling in SA needs some major changes to
>> explicitly count checkouts within the same thread, since the current
>> engine implementation relies upon this (i.e. it cant call close()
>> flat-out without a checkout counter because the connection might still
>> be in use in an enclosing stack frame).
>>
>> can we confirm that this is the case ?
>
> Referring to : http://itmaurer.com/jython/htdocs/presentation.html
>
> it says:
>
> Differences between CPython and Jython
> Some examples:
>
>     * __del__ is not reliable because the Java garbage collector is used
>
> In other words, __del__ should not be used with Jython, since java garbage
> collection is used and with the JVM, actual collection can be a loonngg
> time
> coming.
>
> I do not think this is going to change in later versions of Jython.
>
> I believe I've read a number of times that relying on __del__ for
> "resource
> release" is not recommended.
>
>
>
>
> --
> Brad Clements,                [EMAIL PROTECTED]    (315)268-1000
> http://www.murkworks.com
> AOL-IM or SKYPE: BKClements
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting
> language
> that extends applications into web and mobile media. Attend the live
> webcast
> and join the prime developer group breaking into this new coding
> territory!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
> _______________________________________________
> Sqlalchemy-users mailing list
> Sqlalchemy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users
>



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to