DBFlow icon indicating copy to clipboard operation
DBFlow copied to clipboard

getHelper of BaseDatabaseDefinition no thread safe?

Open bood opened this issue 10 years ago • 6 comments

Looks like no thread protection is done there. In multi-thread environment, looks like it's possible to have more than one FlowSQLiteOpenHelper created. Wouldn't that be a problem?

bood avatar Dec 14 '15 13:12 bood

+1

mathieudebrito avatar Dec 17 '15 09:12 mathieudebrito

@agrosner Could you shed some light on this? or help me understand why this is not a problem?

bood avatar Dec 22 '15 07:12 bood

it's possible, but not recommended. If you need thread-safe operations, or wait for stuff to happen async, use the DBTransactionQueue via BaseTransaction subclasses.

agrosner avatar Jan 10 '16 03:01 agrosner

Hi, I just commented on an related issue (https://github.com/Raizlabs/DBFlow/issues/357) and would like to reopen the discussion about thread safety without using the DBTransactionQueue. Tank you!

BernhardReu avatar Jan 12 '16 10:01 BernhardReu

np @BernhardReu Will put this in next beta.

agrosner avatar Mar 14 '16 17:03 agrosner

fixed in beta6

agrosner avatar Apr 25 '16 01:04 agrosner