CouchbaseLite: Upgrading database v1.0 (15) to v1.1

47 views
Skip to first unread message

David Quon

unread,
Sep 29, 2015, 7:12:45 PM9/29/15
to Couchbase Mobile
We're currently in the process of upgrading CBL on iOS from `1.0.3.1` to `1.1.x`.  If our clients have existing databases built with CBL `1.0.3.1`, the first time CBL `1.1.x` loads those database files the following is displayed in the console.

2015-09-29 15:13:49.695 AppName[39016:8296129] CouchbaseLite: Upgrading database v1.0 (15) to v1.1 at /Users/xxx/Library/Application Support/CouchbaseLite/aaa-db.cblite ...
2015-09-29 15:13:49.710 AppName[39016:8296129]     ...success!
2015-09-29 15:13:49.710 AppName[39016:8296129] CouchbaseLite: Upgrading database v1.0 (15) to v1.1 at /Users/xxx/Library/Application Support/CouchbaseLite/bbb-db.cblite ...
2015-09-29 15:13:49.725 AppName[39016:8296129]     ...success!

This process can take a significant amount of time depending on the size of those databases.  Are there any notifications, delegate calls, etc that can be listened to so a UI can be shown to the user while the database upgrade is happening?

Jens Alfke

unread,
Sep 29, 2015, 9:10:54 PM9/29/15
to mobile-c...@googlegroups.com
No, sorry. You can show a UI, but it would need to be something indeterminate like a barber-pole or a spinning indicator...

—Jens

David Quon

unread,
Sep 30, 2015, 12:19:01 PM9/30/15
to Couchbase Mobile
Hi Jens.  I'm okay with showing an indeterminate indicator but are there any hooks that I can use to know that a database upgrade has started and has completed?

Jens Alfke

unread,
Sep 30, 2015, 3:24:13 PM9/30/15
to mobile-c...@googlegroups.com

> On Sep 30, 2015, at 9:19 AM, David Quon <dav...@amcoonline.net> wrote:
>
> Hi Jens. I'm okay with showing an indeterminate indicator but are there any hooks that I can use to know that a database upgrade has started and has completed?

No; it happens when the CBLManager instance is initialized, so you could start a timer (on another thread) when you first access it, and then put up the UI after something like half a second has elapsed. (Without the database upgrade, initializing the CBLManager is basically instantaneous.)

—Jens

David Quon

unread,
Oct 15, 2015, 2:35:38 PM10/15/15
to Couchbase Mobile
Thanks for your tips Jens.  With them we were able to put up a UI during the upgrading of the database.  Cheers.
Reply all
Reply to author
Forward
0 new messages