react-native-sqlite-2 icon indicating copy to clipboard operation
react-native-sqlite-2 copied to clipboard

Error `cannot commit - no transaction is active` on write transaction on ios.

Open punksta opened this issue 4 years ago • 5 comments

I am getting an error on transaction

cannot commit - no transaction is active
export const createTablesIfNeeded = (database: Database) =>
  new Promise<void>((resolve, reject) => {
    database.transaction(
      txs => {
        txs.executeSql(Queries.createRecipeTable, [])
        txs.executeSql(Queries.createMealPlanTable, [])
      },
      reject,
      resolve
    )
  })

This happens only on ios devices.

I am using version 3.4.1

This code had been working well for almost a year and it's working well in sqlite3 node package environment. I suppose new os or some of dependency broke something.

punksta avatar Oct 25 '21 13:10 punksta

We are experiencing the same issue. It does not happen on every query, but seems to be a bit randomly (at least so far we did not figure out what triggers it). We have occurences starting from iOS 13.7, so this does not seem to be OS-Version specific

miallo avatar Oct 27 '21 16:10 miallo

@punksta Do you know which version you were on before you upgraded to 3.4.1?

DerGuteMoritz avatar Oct 27 '21 16:10 DerGuteMoritz

Hey @DerGuteMoritz

I was using 3.3.0

punksta avatar Oct 27 '21 16:10 punksta

@miallo hi miallo, did you find what is causing this issue in your case?

punksta avatar Nov 08 '21 07:11 punksta

@punksta Unfortunately we did not have the time to look too deep into it, but there seem to be multiple transactions at the same time. Maybe over the next weeks we will have a bit more time to look into it and start trouble shooting

miallo avatar Nov 08 '21 12:11 miallo