[storm] Truncating a table
Gerdus van Zyl
gerdusvanzyl at gmail.com
Tue Dec 9 07:21:48 GMT 2008
You have nothing to fear from using a little raw SQL every now and
again. "TRUNCATE my_table;" is far easier imho than trying to do it
using storm, not to mention faster.
In the code you posted try moving the commit after the for loop.
~G
On Tue, Dec 9, 2008 at 7:39 AM, shawn bright <nephish at gmail.com> wrote:
> This will give you a debug in the terminal
>
> from storm import database
> database.DEBUG = True
>
> hth,
> shawn
>
> On Mon, Dec 8, 2008 at 11:12 PM, Paul Hummer <paul.hummer at canonical.com> wrote:
>> I have a need to basically clear out all the records from a table. I could
>> probably use store.execute, but the reason I'm using an ORM in the first place
>> is to avoid writing SQL. So I have the following code:
>>
>> result = self._store.find(FooBarBaz)
>> self._store.rollback()
>>
>> for foo in result:
>> self._store.remove(foo)
>> self._store.commit()
>>
>> This raises a 'OperationalError : database is locked' on a sqlite database.
>> There are no other operations going on in this instance, so I'm not sure what's
>> going on.
>>
>> This is using storm 0.12. Is there a way that I can debug this and see what's
>> really going on?
>>
>> Cheers,
>> Paul
>>
>> --
>> storm mailing list
>> storm at lists.canonical.com
>> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/storm
>>
>
> --
> storm mailing list
> storm at lists.canonical.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/storm
>
More information about the storm
mailing list