Does the Shared CBLManager get created even when never accessed?

5 views
Skip to first unread message

Brendan Duddridge

unread,
Oct 31, 2016, 6:40:47 PM10/31/16
to Couchbase Mobile
I have logging turned on so I can see when my CBLManager instance gets closed.

I'm finding something odd.

When I close my CBLManager, it looks like there's another instance that's getting closed. I only created one instance. I'm not using the shared CBLManager instance at all. I never reference it. This is because each of my open databases needs its own manager.

When I close, this is what I'm getting:

Database: CLOSING CBLManager[0x6100000f2c00 ~/Library/Containers/com.tapzapp.tapforms-mac/Data/Documents/a bc.tapforms] ...
Database: Closing <0x610000126860> ~/Library/Containers/com.tapzapp.tapforms-mac/Data/Documents/a bc.tapforms/db-f1244ce8d9a249ab8d4e09125a423879.cblite2
Database: CLOSING CBLManager[0x6000002e3200 ~/Library/Containers/com.tapzapp.tapforms-mac/Data/Documents/a bc.tapforms] ...
Database: CLOSED CBLManager[0x6000002e3200 ~/Library/Containers/com.tapzapp.tapforms-mac/Data/Documents/a bc.tapforms]
Database: CLOSING CBLManager[0x6000002e3200 ~/Library/Containers/com.tapzapp.tapforms-mac/Data/Documents/a bc.tapforms] ...
Database: CLOSED CBLManager[0x6000002e3200 ~/Library/Containers/com.tapzapp.tapforms-mac/Data/Documents/a bc.tapforms]
Database: CLOSED CBLManager[0x6100000f2c00 ~/Library/Containers/com.tapzapp.tapforms-mac/Data/Documents/a bc.tapforms]
Tap Forms Mac 5[47228:966066] window will close
... snip a bunch of view controller dealloc messages ...
Database: CLOSING CBLManager[0x6100000f2c00 ~/Library/Containers/com.tapzapp.tapforms-mac/Data/Documents/a bc.tapforms] ...
Database: CLOSED CBLManager[0x6100000f2c00 ~/Library/Containers/com.tapzapp.tapforms-mac/Data/Documents/a bc.tapforms]



There are 2 distinct instances of CBLManager; 0x6100000f2c00 and 0x6000002e3200.

I'm assuming since I see only one database file being closed that it's the one connected to my created instance and the other one is from the shared instance.

What I'm not sure about is why it's closing each one twice.

I'm only calling close once on my own CBLManager instance.

Is this normal or is it a byproduct of something I'm doing incorrectly?

Thanks,

Brendan

Jens Alfke

unread,
Oct 31, 2016, 6:49:07 PM10/31/16
to mobile-c...@googlegroups.com

On Oct 31, 2016, at 3:40 PM, Brendan Duddridge <bren...@gmail.com> wrote:

When I close my CBLManager, it looks like there's another instance that's getting closed. 

It’s probably the one on the Couchbase Lite background thread (the thread that runs the replicator and async queries.)

—Jens
Reply all
Reply to author
Forward
0 new messages