Almost forgot...
Transaction remains open during all the FireFox session.
That's a big problem because it could cause serious data integrity problems
in case of crashes or similars.
Anyway, as it seems, it is impossible to commit it.
2008/8/1 Marco Pivetta <[EMAIL PROTECTED]>
> I'm getting NS_ERROR_FAILURE from mozIStorageConnection.beginTransaction
> and mozIStorageConnection.commitTransaction.
>
> The code involved in this problem is very very very simple...
>
> * try
> {
> AccountDB
> .beginTransaction();
> }
> catch(e)
> {
> alert(e)
> }*
>
>
>
> * try
> {
> AccountDB
> .commitTransaction();
> }
> catch(e)
> {
> alert(e)
> }*
>
>
> and
>
> *AccountDB *
>
> is a working *[xpconnect wrapped mozIStorageConnection]* ...
>
> The first time that *.beginTransaction()* is launched everything works
> fine, but when execution reaches* .commitTransaction()* the result is a
> NS_ERROR_FAILURE:
>
> [Exception... "Component returned failure code: 0x80004005
> (NS_ERROR_FAILURE) [mozIStorageConnection.commitTransaction]" nsresult:
> "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame ::
> chrome://standardogame/content/classes/Ranks.class.js :: anonymous :: line
> 405" data: no]
>
> When the code is launched again, ALSO *.beginTransaction() *causes an
> NS_ERROR_FAILURE (obviously! Another transaction has been started just
> before!)
>
> [Exception... "Component returned failure code: 0x80004005
> (NS_ERROR_FAILURE) [mozIStorageConnection.beginTransaction]" nsresult:
> "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame ::
> chrome://standardogame/content/classes/Ranks.class.js :: anonymous :: line
> 79" data: no]
>
> Does anybody know if there's a way to discover if a transaction is already
> started?
> My code is strongly asynchronous because of a lot of XMLHttpRequests. I
> checked it out and discovered that an alert() halting the code just before
> the *.beginTransaction() *stops the errors from appearing. That means
> there's some kind of lock on the database while I'm working on it. How can I
> discover if there's a lock? And if there is some file lock, how could i work
> with it? I need to use transactions because of 5000+ row inserts (3 minutes
> of cpu usage without transactions, 3 seconds WITH transactions). Any idea?
>
> If you need more details I'll also pastebin all the code, but I don't think
> it is relevant.
>
> --
> Standard Ogame Project - StOgame
> http://www.stogame.net
> Making Ogame a better place...
>
--
Standard Ogame Project - StOgame
http://www.stogame.net
Making Ogame a better place...
_______________________________________________
Project_owners mailing list
[email protected]
https://www.mozdev.org/mailman/listinfo/project_owners