In the documentation to IndexedDB I find examples like this
// Let us open version 4 of our database
var DBOpenRequest = window.indexedDB.open("toDoList", 4);
// these two event handlers act on the database being opened
// successfully, or not
DBOpenRequest.onerror = function(event) {
note.innerHTML += '<li>Error loading database.</li>';
};
DBOpenRequest.onsuccess = function(event) {
note.innerHTML += '<li>Database initialized.</li>';
// store the result of opening the database in the db
// variable. This is used a lot later on, for opening
// transactions and suchlike.
db = DBOpenRequest.result;
};
As far as I understand, this first creates a request object and then defines two callbacks. But it never calls any code to execute the request. Still it seems to execute it sometime.
I am especially interested in the details, as it seems to be complicated to run different transactions after each other as transactions seem to be asynchronous.