Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1)

Issue 2423: Asynchronous execution minus threading and queueing

Can't Edit
Can't Publish+Mail
Start Review
Created:
17 years, 11 months ago by Dimitri
Modified:
11 years, 5 months ago
Reviewers:
gears-eng, zboogs
Base URL:
http://gears.googlecode.com/svn/contrib/dimitri.glazkov/database2.1/
Visibility:
Public.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+478 lines, -140 lines) Patch
gears/database2/commands.cc View 4 chunks +70 lines, -10 lines 1 comment Download
gears/database2/connection.cc View 2 chunks +95 lines, -52 lines 0 comments Download
gears/database2/database2.h View 2 chunks +4 lines, -2 lines 0 comments Download
gears/database2/database2.cc View 3 chunks +77 lines, -19 lines 4 comments Download
gears/database2/interpreter.cc View 1 chunk +8 lines, -0 lines 0 comments Download
gears/database2/statement.h View 2 chunks +7 lines, -2 lines 0 comments Download
gears/database2/statement.cc View 1 chunk +56 lines, -9 lines 1 comment Download
gears/database2/transaction.h View 3 chunks +6 lines, -6 lines 0 comments Download
gears/database2/transaction.cc View 5 chunks +19 lines, -8 lines 0 comments Download
gears/test/testcases/database2_tests.js View 4 chunks +136 lines, -32 lines 0 comments Download

Messages

Total messages: 2
Dimitri
This one is a bit overweight, but it seemed like a good logical chunk of ...
17 years, 11 months ago (2008-06-22 01:38:24 UTC) #1
zboogs
17 years, 11 months ago (2008-06-27 00:21:50 UTC) #2
Here are some quick comments.

As we talked about on IM, I have a nagging concern that the interpreter approach
is a little bit complex. I have a difficult time keeping it in my head, which
makes me worry that maintenance will be tough.

I'd like it if you could take a look at making one class (Transaction, or maybe
Database?) really encapsulate the transaction steps algorithm, so that you can
see how the steps flow relatively easily.

http://codereview.appspot.com/2423/diff/1/4
File gears/database2/commands.cc (right):

http://codereview.appspot.com/2423/diff/1/4#newcode68
Line 68: transaction->InvokeErrorCallback();
It doesn't seem like it should be a requirement for there to be a tx error
callback. Therefore, this should fall through to throwing a global error in that
case.

http://codereview.appspot.com/2423/diff/1/9
File gears/database2/database2.cc (right):

http://codereview.appspot.com/2423/diff/1/9#newcode69
Line 69: if (!error->SetPropertyInt(kErrorCodePropertyName, code)) {
I don't see the definition of this constant. Did a change to database2_common
get missed? Same with below.

http://codereview.appspot.com/2423/diff/1/9#newcode150
Line 150: if (!tx->open()) {
Maybe change open() to is_open()? This confused me for a second.

http://codereview.appspot.com/2423/diff/1/9#newcode156
Line 156: if (!tx->InvokeCallback()) {
Can you throw a comment in here noting that this actually runs the entire
callback synchronously?

http://codereview.appspot.com/2423/diff/1/9#newcode158
Line 158: tx->QueueRollback();
Do we need to check that it hasn't already rolled back?

http://codereview.appspot.com/2423/diff/1/6
File gears/database2/statement.cc (right):

http://codereview.appspot.com/2423/diff/1/6#newcode83
Line 83: // If callback returns a non-boolean value, report callback failure.
This ends up being GET_INTERNAL_ERROR I think. It would be better if it just
considered non-booleans as false (eg coerce to boolean). I think this is what
workerpool does today.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b