tags:

views:

42

answers:

0

While i am trying to sync data from server to client, it took 1 second to fetch 100 rows from server but taking 10 to 20 seconds while inserting to sqlLite. The below code is not fast enough.

var db = google.gears.factory.create('beta.database'); db.open('my_database');

db.execute('BEGIN');

try {
  // do lots of db.executes() here
  db.execute('COMMIT');
} catch(exp) {
  db.execute('ROLLBACK');
} finally {
  db.close();
}

Is there any other pattern available to perform transaction based insertion in google-gears?