Hi James,
sorry I didn't see you email earlier... No idea why...
You are completely right on your question.
However to answer those question I would need to know how rediSQL would be
used, which I can't.
Right now I can only deference those choice to whoever is using it.
/2) I need some way to indicate if an error occurs during a write />>/operation, which
is a problem I am not able to solve in a reasonable />>/bound of complexity. />
I'm not sure I understand. SQLite will commit the transaction
atomically. If the transaction fails for logical or physical reasons,
the error is indicated at commit time. How is indicating that error to
the user in any way difficult?
Suppose I have a empty buffer.
Now it comes a write statement, something like: `INSERT INTO ...`
I push that statement in a buffer and I ack to the client that is request is
been processed.
Now it comes another write statement, `UPDATE ...`
I push also that statement into the buffer and I ack the client.
Now I decide to write all into disk, so I start a single transaction, run the
insert,
run the update, and then commit.
Unfortunately either the INSERT or the UPDATE fails.
The whole transaction is aborted and I should indicate something to the client.
Clearly the problem is that I am doing a single transaction, but if that is
necessary for performance...
It is my problem a little clearer ?
Best,
Simone
/I could store in some buffer some SQL statement and I could execute />>/all of
them in one single transaction. />
That's a good idea, all things being equal. But are they equal? Your
problem description is entirely technical. It doesn't address how
transactions map onto the problem domain.
Question you should ask yourself:
1. What is the unit of work? What combinations of operations
constitute a logically consistent change to the database?
2. How many units of work are you prepared to lose in the event of
system failure? That determines how often you commit.
/2) I need some way to indicate if an error occurs during a write />>/operation, which
is a problem I am not able to solve in a reasonable />>/bound of complexity. />
I'm not sure I understand. SQLite will commit the transaction
atomically. If the transaction fails for logical or physical reasons,
the error is indicated at commit time. How is indicating that error to
the user in any way difficult?
--jkl
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users