jean-marc pouchoulon wrote:
> helo,
> I don't understand why my sqlite database is locked on a drop ( the code
> is following)
> thanks for your explanation.
>
> [...snip...]
> ordinateurs = computers_table.select(computers_table.c.prix <
> 100.0).execute()
> ordinateur_pas_cher = ordinateurs.fetchone()
> print ("marque d'un ordi pas cher: %s ") % ordinateur_pas_cher.marque
>
> ordinateurs = computers_table.select(and_((computers_table.c.prix >
> 1000.0),(computers_table.c.prix > 1000.0))).execute()
> ordinateur_medium_price = ordinateurs.fetchone()
> print ("marque d'un ordi medium price: %s ") % ordinateur_pas_cher.marque
>
> ordinateurs =
> select([computers_table.c.marque,computers_table.c.prix]).execute()
> for ordi in ordinateurs:
> print "marque:%s prix:%s" % (ordi[0],ordi[1])
>
> result_os.close()
> ordinateurs.close()
Here you're holding onto open cursors with 'something ==
ordinateurs.fetchone()'. Either explicitly close() the two result sets
you're accessing with fetchone() or remove your reference to the rows
and python gc will get around to closing the cursors at some point.
-j
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---