Inxdb Uncaught TypeError: Cannot read property 'transaction' of undefined

IndexedDB
Uncaught TypeError: Cannot read property ‘transaction’ of undefined line 93

I am getting on below trying list entries on load/refresh of jQuery mobile page

var transaction = databaseObj.[B]transaction/B; // line 93 - transaction undefined

var idb = indexedDB.open('myIDBVideoHistory', 1);
var databaseObj;

idb.onupgradeneeded = function(event){
	event.target.result.createObjectStore('entries',{keyPath:'entrydate'});

}

idb.onsuccess = function(event){
	databaseObj = event.target.result;
}

$(document).ready(function(e) {
    showAllEntriesInit();//showAllEntries
});

function showAllEntriesInit(){
var t=0;
var h = $('history-played');
h.html = '';
var transaction = databaseObj.transaction("entries", "readonly");   // line 93
var store = transaction.objectStore("entries");
var request = store.openCursor(IDBKeyRange.lowerBound(0), 'prevunique');
request.onsuccess = function(event) {
  var cursor = event.target.result;

I am a reader of sitepoint book Html5 offline apis…indexedDB chapter…
If i want apply data result from indexedDB to list view jQ mobile and apply onclick event in each with a data attr as param to onclick function… you have any sample code?

function buildListItem(entry){
	var o,
		li = document.createElement('li'),
		a = document.createElement('a'),
		h = document.getElementById('history-played');

	a.href="#";
	a.setAttribute("class","ui-btn ui-btn-icon-right ui-icon-carat-r");
	a.setAttribute("data-link-url-v", entry.url ); 
	a.innerHTML = new Date(+entry.entrydate).toDateString() + " " + entry.url;
	li.appendChild(a);  

	h.appendChild(li);
}