That makes sense regarding there being no grantee on the order of the operations.
As an extension of the question, I am wondering about the clustering of H2. It seems that non-read only statements are sent to both databases (and there are clear limitations as outlined in the docs). While I have not looked at the code, it seems that the update executes are simply run on all nodes, but will that always lead to the same database? Take for example, a simple update that changes an value. Two statements are executed in parallel by two different connections. The connection A sets the value to 1, and connection B sets the value to 2. In a cluster, the statements are executed on both nodes, but since we can't guarantee the order of the statements (as previously discussed), it seems that it is possible that nodes in the cluster might have different values for that data (depending on which statement executes first). One node might have 1 as the value, but the other could have 2? Is this correct? Or is something else going on in the clustering to prevent this from occurring. Thanks, -Adam On Oct 31, 11:20 am, Noel Grandin <[email protected]> wrote: > There is no guarantee. But that is the case with pretty much every SQL > database engine out there. > > Note also that there is no global lock. Transactions will acquire > row-level, and perhaps table-level locks, so two or more connections > can actually execute at the same time. > > > > > > > > On Mon, Oct 31, 2011 at 18:08, Adam McMahon <[email protected]> wrote: > > Noel, > > > Thanks for the link. But, I did not find anything on the order of the > > statements (but perhaps I missed it). Lets say that one connection is > > executing and has the lock, and two others are blocked temporarily. > > Then after the release, one of the other two will get access and > > perhaps lock the Database? But which one will get access? That is > > what I am trying to understand. Will the SQL statement that was > > submitted first get access (is it a type of queue), or is there no > > guarantee on this? > > > Thanks, > > > -Adam > > > On Oct 31, 1:08 am, Noel Grandin <[email protected]> wrote: > >> seehttp://www.h2database.com/html/features.html#multiple_connections > > >> Adam McMahon wrote: > >> > Hi, > > >> > Quick question. As I understand it, H2 handles the synchronization of > >> > SQL commands. If a number of SQL commands hit the database from a > >> > variety of connections, do they execute in the order that H2 receives > >> > them? If not, can a brief explanation be provided? > > >> > Thanks, > > >> > -Adam > > > -- > > You received this message because you are subscribed to the Google Groups > > "H2 Database" 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 > > athttp://groups.google.com/group/h2-database?hl=en. -- You received this message because you are subscribed to the Google Groups "H2 Database" 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/h2-database?hl=en.
