Is it possible to query inside a SQLite transaction?

I am using SQLite3 database system in android library.

I need to execute a query during a transaction to see if there is a similar record there. If there is, I have to do some other logic and tweaks before adding the new line.

Is it possible to execute a query in a transaction and return the result immediately?

+2


a source to share


2 answers


Yes, it's safe.



+4


a source


The answer should be yes, but only if you are making requests on the same thread in which the transaction was started. Even if you are using the same database connection, queries are completely complete if executed on different threads when you are inside a transaction (despite transaction mode).



+6


a source







All Articles