In this code I am facing problem at store1.add when I look in console it says TransactionInactiveError: Failed to execute 'add' on 'IDBObjectStore': The transaction is not active. 
Any one help me, if possible give some sample code.
function indexInitialization(){
     var userDetails = indexedDB.open("dynamicServicess");
     userDetails.onupgradeneeded = function(e) {
         console.log("Upgrading...");
         var thisDB = e.target.result;
         var objectStore=thisDB.createObjectStore("servicess",{keyPath: "ID"});
         var objectStore2=thisDB.createObjectStore("businessareas",{keyPath: "ID"});
         var objectStore3=thisDB.createObjectStore("languages",{keyPath: "ID"});
         var objectStore4=thisDB.createObjectStore("rolenames",{keyPath: "ID"});
         objectStore2.createIndex("language", "LANGLOCALE", { unique: false });
         objectStore.createIndex("businessarea", "BUSINESSAREA", { unique: false });
     objectStore.createIndex("rolename", "ROLENAME", { unique: false });
     }
     userDetails.onsuccess = function(e) {
         console.log("Success!");
         db = e.target.result;
         indexedDbObjectCreation();
     }
     userDetails.onerror = function(e) {
         console.log("Error");      
         console.dir(e);
     }
}
function indexedDbObjectCreation(){
 var transaction = db.transaction(["servicess"],"readwrite");
 var transaction1 = db.transaction(["businessareas"],"readwrite");
 var store = transaction.objectStore("servicess");
 var store1 = transaction1.objectStore("businessareas");
 var req = store.clear();
 var req1 = store1.clear();
 for(i=0;i<result.invocationResult.resultSet.length;i++){               
    store.add({ID:i,SERVICENAME:ss.resultSet[i].SERVICENAME,LANGLOCALE:ss.resultSet[i].LANGLOCALE});    
    }
  var index = store.index("businessarea");
  var singleKeyRange = IDBKeyRange.only("en");  
  index.openCursor(singleKeyRange).onsuccess = function(event) {
    var cursor = event.target.result;
    if (cursor) {
    store1.add({ID:cursor.value.ID,SERVICENAME:cursor.value.SERVICENAME});
       // it is not working error:TransactionInactiveError: Failed to execute
        // 'add' on 'IDBObjectStore': The transaction is not active.
    cursor.continue();
    }
  };
}
 
     
     
    