[Tutor] best approach to db-api imports and cursor calls

Serdar Tumgoren zstumgoren at gmail.com
Thu Aug 13 02:10:06 CEST 2009


> My understanding is that it is relatively expensive to connect() and
> cheap to create cursors. Cursors are also associated with
> transactions. So a common practice seems to be to create a connection
> that is shared in some way, and to create a cursor for each
> transaction / operation.
>
> Kent

Is there any reason why you can't reuse the same cursor object? I know
when you're writing to a database, you have to be sure to commit your
changes. But if I'm just issuing execute statements and then fetching
data, is it okay to reuse the same cursor?


More information about the Tutor mailing list