Java

Java

1.3.1 14 September 2016


As part of this release we had 39 commits which resulted in 9 issues being closed.

Enhancements

  • #1376 Implement timeout parameter for _changes REST API
  • #1387 Support for refresh response without ID token

Bugs

  • #1296 Cordova - After putting Android app in background mode for a few hours, CB lite is unresponsive
  • #1372 Router unable to route request to doDesignDocument (ForestDB)
  • #1375 Reduce intermittently returns wrong results for 1.3.0-45
  • #1379 MultipartDocumentReader: Attachment length cannot be parsed as Integer
  • #1386 POST _replicate not create replicators when altering props beside type, target/source
  • #1394 ViewsTest.testDeleteView() test failure
  • #1399 Longpoll _changes on Listener does not respect timeout property
  • #93 CBL Java 1.3.0 does not work with JDK 1.7

Download

You can download 1.3.1 from Couchbase.com

System Requirements

  • JDK 1.7+

1.3 Thursday, August 3, 2016


As part of this release we had 48 commits.

This is a feature release, with a focus on performance. Noteworthy changes:

  • Support for OpenID Connect authentication, so you can log into Sync Gateway using a 3rd-party identity like a Google or Yahoo ID.
  • Timed expiration of documents can help keep your database from growing indefinitely.
  • Better performance with docs that have many revisions. Replication is faster, and older revisions are now automatically cleaned up in SQLite storage.
  • Eliminate HttpClient library, and replace with OkHttp.
  • And of course many smaller optimizations, and lots of bug fixes.

Enhancements

  • #708 Apache HTTP Client Removal/Deprecated in Android M.
  • #820 Filter out _removed revision from push replication
  • #1054 Support POST /_changes in Listener
  • #1057 cbforest master branch version fails with many unit test (1.2.0-java -> master)
  • #1097 After purging a doc, its rows are left behind in view indexes
  • #1099 Docs in SQLite dbs never get pruned until entire db is compacted
  • #1194 Fallback to GET when POST is not allowed to _changes
  • #1207 TTL support
  • #1222 Make SQLite one writer and one/multiple reader modes to avoid waiting connection.
  • #1247 Add public API to add an existing revision (AKA new_edits=false, or -forceInsert:)
  • #1255 Authenticator for OpenID Connect

Bugs

  • #310 post on doc without data returns 404 instead of 405
  • #667 Using PipedInputStream and PipedOutputStream in URLConnection can cause deadlock (see issue 57 in couchbase-lite-java-listener)
  • #880 query for view with map-reduce function and startkey doesn't work properly
  • #891 Fix failing tests (on Jenkins/VM)
  • #952 Views broken with concurrent update and delete
  • #1015 NPE Attempt to invoke virtual method int com.couchbase.lite.Database.findMissingRevisions on a null object reference
  • #1026 Change tracker stopping during replication exception
  • #1037 Proxy setting on Android blocks access to Listener
  • #1073 ForestDB CBL 1.2 random crash.
  • #1090 Android API 10: java.lang.UnsatisfiedLinkError: nativeOpen
  • #1091 ReplicationTest > testPusherBatching FAILED with CBL Java
  • #1095 CBL 1.2 ForestDB random crash.
  • #1098 Querying local CBLite via REST API returns all doc revisions (not just current rev)
  • #1161 CBL - 1.2.0 upgrade from 1.1.0 clears device db
  • #1176 ForestDB CBL 1.2 crash in endTransaction()
  • #1177 ForestDB CBL 1.2 crash.
  • #1193 Return 405 (Method Not Allowed) instead of 404 if Router does not support requested REST API
  • #1196 Crash in ForestDB (filemgrfully_resident)
  • #1201 GrocerySync crashes with ForestDB
  • #1210 Listener ?attachments=true to return attachment in base64
  • #1211 supports only_conflicts and include_conflicts query parameters for _all_docs REST API
  • #1222 Make SQLite one writer and one/multiple reader modes to avoid waiting connection.
  • #1227 Port: Crash when saving, conflict generated and infinite replication loop
  • #1232 ManagerTest.testClose() failed with latest master branch
  • #1235 BackFillTest.testPullReplWithRevsAndAtts() fails
  • #1236 PullReplWithRevsAndAttsTest.testPullReplWithRevsAndAtts() fails
  • #1241 couchbase-lite-java-forestdb is not build-able on Windows
  • #1243 Push replication from Android LiteServ and sync_gateway not pushing all deleted documents
  • #1245 CBL Java/Android can not handle complex Accept: header value
  • #1249 Purge does not update view on ForestDB Mobile
  • #1263 Deleting a db takes over 1 min.
  • #1264 Querying a design document view returns deleted documents too REST API
  • #1270 Forestdb Handle is being used by another thread (Note: ForestDB error code = -39)
  • #1272 400 Missing data of attachment while pushing attachments
  • #1275 Very slow doc PUT's with lots of garbage collection.
  • #1276 ForestDB CBL crash.
  • #1285 OkHttp ConnectionPool thread leaking
  • #1289 SecureTokenStore does not work with Android M/N and there is encrypting data size limitation for API 18 - 22
  • #1297 590 Database error (Note: ForestDB error code = -39)
  • #1299 get just attachment with header 'Accept: applicatio/json' should return {"status" : 406, "error" : "not_acceptable"}
  • #1300 compaction doesn't work with ForestDb
  • #1301 ForestDB throws exception from native call (Note: ForestDB error code = -39)
  • #1308 Encrypted attachments fail to sync
  • #1315 Replicator shouldn't go to IDLE state if the authenticating is not done
  • #1319 Autopruning failing on pull replication
  • #1324 OIDC shouldn't clear refresh token after refreshing the token
  • #1332 Cancelling a replication does not return a response.
  • #1333 OIDC: Obtaining username with refresh-token might have issue
  • #1339 Make lower initial heartbeat value for /_changes REST API
  • #1342 Unit Test Failures on Jenkins
  • #1355 Listener does not return response for PUT /db
  • #1356 Listener does not return response for DELETE /db
  • #1367 Live Query Seems broken with ForestDB
  • #73 Bad content negotiation in lite listener

Download

You can download 1.3.0 from Couchbase.com

System Requirements

  • JDK 1.7+

1.2.1 Thursday, April 21, 2016


Couchbase Lite for Java is a maintenance release.

Download

You can download this release from Couchbase.com

Performance Improvements

  • #987 URL.equals blocks on DNS lookup
  • #990 Unnecessary boxing/unboxing when parsing Long column in SQLiteViewStore
  • #992 Unnecessary synchronization due to using StringBuffer local variables
  • #994 Repeated byte array conversion of a string constant in SQLiteStore documentPropertiesFromJSON
  • #1001 Refactor out duplicate method call in ReplicationInternal.transformRevision
  • #1018 Static Analyze: Performance issues - part 1

Enhancements

  • #1008 External property on database change event
  • #1013 Static Analyze: Verbose or redundant code constructs
  • #1064 Apply pause logic to queued changes in beginReplicating()
  • #1074 Enhance logging information of replicator thread
  • #40 Listener: Serious performance issue
  • #67 Update thread pool size and connection count to the same values

Bugs

  • #976 Pull replication not working when device goes offline and back online
  • #985 Missing 'throw' keywords when attempting to re-throw an exception
  • #1009 Static Analyze: XML issues
  • #1020 Static Analyze: Imports issues
  • #1022 Static Analyze: Performance - static method
  • #1024 Static Analyze: Remove Unused java class
  • #1028 Improve logging for local check point conflicted error
  • #1030 Requests to Listener in pending state
  • #1033 Requests pending with POST docs
  • #1036 DELETE /db causing the Listener to hang
  • #1041 Custom property with the name 'type' results in an exception
  • #1043 Listener exception in remote database of a replication
  • #1047 Push replication skipped 20 documents
  • #1050 Implement non-problematic flow control logic for push replicator
  • #1052 connection in Router.change(ChangeEvent) is critical section
  • #1061 NullPointerException in Implementation of Validator
  • #1068 Pull replication skipped documents
  • #1069 Deleting database and stopping replications at the same time
  • #1076 Batcher inbox.size() == 0 is not good enough to check if Batcher is empty.
  • #1082 Impossible to get non-reduced view from CBL Listener
  • #1092 Push replicator might skip some documents under unstable network connectivity
  • #1093 Listener does not accept new connection
  • #1104 Push replicator stops unexpectedly with CBL Listener
  • #1106 DuplicatedChangeTrackers
  • #1108 Too many open files error on push replication
  • #1110 PUT with Content-Type other than application/json succeeds
  • #1112 Multiple ChangeTrackers are started (Scenario 2)
  • #1114 Thread stuck in RemoteRequestRetry.get
  • #1116 Multiple ChangeTrackers are started (Scenario 3)
  • #1122 Pull and Push replicator stops during replication
  • #1124 Test: Unit Test failure on jenkins
  • #1129 [Scenario 1] Pusher missing docs: Potential race condition when calling PusherInternal.removePending()
  • #1130 current implementation of shouldRetryDownload() could cause missing document without restart replicator
  • #1131 UnitTest, ReplicatoinTest.testStartReplicationClosedDb(), fails with recent commit.
  • #1135 [Scenario 2] Pusher missing docs: Last sequence jump during replication retry
  • #1136 Push Replicator causes dead-lock in case of setting RemoteRequestExecutor thread-pool size 1
  • #1141 Thread-waitForPendingFutures is leaking
  • #1143 sequence number is not set in RevisionInternal when Changes are pull replicated
  • #1147 [Scenario 4] Missing changes in Database Change Notification
  • #1149 Push replicator keeps postponing the retry with error if Database.changed() events are fired continuously.
  • #1151 Pull replicator keeps postponing the retry with error if ChangeTracker receives changes continuously.
  • #1153 Listener returns incorrect version string for dev builds
  • #1154 Should not call parentReplication.isPull() from ReplicatonInternal
  • #1157 Replication.stop() sometimes fails to stop pull replication
  • #1158 ReplicationInternal.stop() never executed.
  • #1163 Replicator sends duplicated Replicator state.
  • #1173 Zip file contains duplicated jar and aar files
  • #1174 Document's changeListeners list should be thread safe
  • #1180 Router: PUT /{db}/{doc} If-Match header is not supported
  • #57 Large amount of response data causes deadlock
  • #62 Simultaneous requests can sometimes lock the listener
  • #68 1.2.1 Listener reporting invalid number
  • #71 TJWS set SO_TIMEOUT value 0 in Serve.java. It causes hanging state in listener.

System Requirements

  • JDK 1.7+

Support Statement

Version 1.1 was released in June, 2015. With the release of version 1.2, the support window for 1.1 expires in August 2016.

Release Release Date End of Life Date
1.0 May 2014 December 2015
1.1 June 2015 August 2016
1.2 February 2016

1.2.0 February 3, 2016


This release features a number of performance improvements, enhancements, and bug fixes, including:

  • ForestDB Storage Engine (Developer Preview) - Preview the speed of our new ForestDB storage engine.
  • Database Encryption - AES-256 on-disk encryption with your choice of provided storage library: SQLCipher or ForestDB.
  • Improved Developer Experience - You no longer need to compile native native code to use Couchbase Lite for Java on Linux, OS X, or Windows.

Performance Improvements

  • #704 ForestDB storage Performance improvement
  • #749 Slow when creating a BlobStore with a secure random generated key
  • #801 Replace JNI-based JSON collation with ICUC

Enhancements

  • #68 Integrate with SQLCipher to support database encryption
  • #69 Enhance JavaSQLiteStorageEngine
  • #321 Test CBForest storage engine
  • #417 Add API to tell which documents haven't been pushed to the server
  • #435 One shot replicator sends STOPPING state immediately after started replication
  • #535 The replicator's setDocIds method doesn't filter the documents to push
  • #573 Port Replication.stop() method from iOS
  • #576 Changetracker does not automatically login again after expired session
  • #628 Catch up latest (v1.1) SQLite table schema and SQL queries
  • #644 Implement pluggable storage engine
  • #663 Make available on JCenter
  • #681 Catch up latest (v1.1) View.updateIndex() implementation
  • #682 Add "_conflicts" property to doc in map function when doc is in conflict
  • #683 [Request] Make Attachment.getContentURL() api public for android.
  • #688 Expose CBLView.totalRows to public
  • #691 Add BySequence to AllDocsOptions
  • #695 Add replicator support for remote dbs with varying URLs
  • #697 Complete CBForest-Java Implmentation and Test
  • #702 Add support for SQLCipher
  • #703 Implement ForestDB Storage Engine
  • #704 ForestDB storage Performance improvement
  • #710 Encrypt file attachments
  • #719 Support SQLite encryption rekey feature
  • #720 Support attachment encryption rekey
  • #722 Migrating SQLite db to ForestDB
  • #733 Enhance forestdb storage performance
  • #736 Add retry queue for failed revisions in a bulk get
  • #760 Sync iOS key derivation and encryption algorithm with iOS
  • #763 Enable HTTP compression for _changes feed requests (non-continuous)
  • #801 Replace JNI-based JSON collation with ICUC
  • #804 Add official openDatabase API for encryption/storage options
  • #811 Support encryption in ForestDB storage engine
  • #812 Support unicode comparison with ICU for java
  • #813 Support unicode comparison with ICU for AndroidSQLCipherStorageEngine
  • #816 REST API /_changes with include_docs=true option does not handle the conflicted document
  • #819 Support multiple sqlite configurations
  • #827 Support encryption in ForestDBStore
  • #894 Replication.docIds API discrepency
  • #939 Optimize first-time sync

Bug fixes

  • #62 IllegalArgumentException: Invalid database name: foward:slash after update to the latest cblite version
  • #301 [Memory] compacting large database memory leak
  • #643 Add conflict check in PullerInternal.processChangeTrackerChange()
  • #652 Refactor Batcher class (Port latest codes from iOS)
  • #655 Unique constraint violation in sqlite
  • #661 BasicAuth with empty password causes ArrayIndexOutOfBoundsException
  • #664 Creating authenticator with empty password throws ArrayIndexOutOfBoundsException
  • #670 LiteServ crashed with Fatal signal 11 (SIGSEGV) when run cbl-large-revisions localy
  • #677 Pulling attachments fail if document got a deleted revision in history
  • #689 CBL Java build (unit test) failure on Jenkins
  • #696 Support for CBLReplication.pendingDocumentIds
  • #699 Inserting multiple attachments fails when push replication is active.
  • #700 Build failure with CBL Java on jenkins
  • #706 ClassCastException if a view uses an array as value
  • #707 PullerInternal processInbox Issue
  • #709 View update skips winning revisions
  • #712 ReplicationTest.testAllLeafRevisionsArePushed() unit test failure with forestdb strage engine
  • #713 BatcherTest.testBatcherWaitsForProcessorDelay2() fails
  • #717 TestContinuousPushReplicationGoesIdleTooSoon causes native crash if unit test run from command line on OSX
  • #718 Android-database-sqlcipher doesn't provide 64 bit binary
  • #723 401 status from server not being propagated to CBLReplication.lastError
  • #724 Android build on Jenkins fails
  • #728 Replicator should not stop by missing revisions
  • #729 ApiTest:testViewWithLinkedDocs hangs when running unit tests with couchbase-lite-java
  • #731 ForestDB storage cause native crush during push replication performance test with 200 docs
  • #735 ApiTest.testConflict() test failure
  • #748 Java doesn't support generating 256 bits key
  • #749 Slow when creating a BlobStore with a secure random generated key
  • #750 ReplicationTest.testPusherBatching() causes native crash with forestdb storage on ARM emulator API 19 (4.4.4)
  • #765 ApiTest.testDatabaseCompaction passed with ForestDB Errors
  • #771 BloblStoreTest failed on Windows
  • #780 Closing database doesn't clear document cache
  • #791 Invalid MIME body after starting pull replication
  • #809 Jenkins: testMockPullBulkDocsSyncGw fails on Jenkins
  • #816 REST API /_changes with include_docs=true option does not handle the conflicted document
  • #823 SetMaxRevTreeDepth not working as intended after Compaction is called.
  • #824 BulkDownloader[/db/_bulk_get]: executeRequest() Exception: java.lang.IllegalStateException: _docReader is not defined
  • #826 Database maxRevTreeDepth property should be public property or API
  • #829 From code point of view, Database.getAllDocs(QueryOptions) is not compatible with iOS
  • #830 Replication should stop immediately if error is not transient error.
  • #833 Jenkins: testChangesFeedWithPurgedDoc cause native crash
  • #838 TestContinuousPushReplicationGoesIdle hangs on Jenkins
  • #851 In case ChangeTracker stops with HTTP 401, Continuous pull replicator does not stop
  • #852 Cookie is not set for /{db}/_revs_diff with one shot push replication
  • #899 Batcher not always execute tasks with work executor
  • #900 Views Test failure on Windows when tested with ForestDB Storage Engine
  • #902 Forestdb Transaction Error on Linux
  • #924 Creating view with illegal name does not handle error appropriately.
  • #930 CBLRequestWorker thread does write operation to Database
  • #934 Pull replication failed for large pull
  • #935 GrocerySync with ForesDB crashes during pull replication
  • #937 ForestDB: Cause dead-lock by create docs from main thread during large pull replication
  • #941 Push Replicator hangs under certain condition
  • #947 ToDoLite with SQLCipher/ForestDB with Encription can not push attachment.
  • #954 Conflict during putLocalDocument: Need to investigate
  • #961 ReplicationTest failure on Windows by non-closed InputStream
  • #963 Cannot pull changes after sync_gateway goes offline, then online
  • #964 ToDoLite crashes during clear Cookie
  • #965 [forestdb] All items not replicating between device and sync_gateway
  • #967 Apply fix for iOS 1082 - Delete docs could cause missing undeleted docs in ForestDB view index
  • #971 ForestDB exception in query iterator

Download

You can download this release from Couchbase.com

System Requirements

  • JDK 1.7+

Support Statement

Version 1.1 was released in June, 2015. With this release of version 1.2, the support window for 1.1 expires in August 2016.

Release Release Date End of Life Date
1.0 May 2014 December 2015
1.1 June 2015 August 2016
1.2 February 2016

1.1.0 June 17, 2015


Couchbase Lite for Android v1.1.0 focuses several new features and enhancements including:

  1. Improved replication and view indexing performance.
  2. Significant reduction in memory usage when processing many documents.

Note:Couchbase Lite 1.1.0 has a new optimized database schema which is not backwards compatible with 1.0.4 and earlier release. Once automatically migrated to the Couchbase Lite 1.1.0 format, your application’s .cblite database files are no longer readable by earlier versions. This would only impact developers attempting to share a database among multiple apps running different versions of Couchbase Lite, or Couchbase Lite downgrade scenarios.

Features and Improvements

  • #590 Add in replication optimization from iOS version
  • #400 Querying without updating the view
  • #376 Pull replication slow
  • #360 REST API need a way to setCookie
  • #343 Control EXECUTOR_THREAD_POOL_SIZE
  • #328 Excessive checkpointing during push replication
  • #81 HttpMime library source code integration in couchbase breaks existing code

Bug fixes

  • #654 "Window is Full" during View.updateIndex()
  • #636 Push replication "losing" documents created when disconnected
  • #635 Jackson deserialization exception
  • #614 Push a small doc with an attachment failed
  • #600 Push replication to rcouch fails on rev with attachments
  • #596 Handle SQL 'attach' table incompatibility in CBL 1.1
  • #587 Starting an AsyncTask right after Document.putProperties(), does not call the doInBackround() method?
  • #585 toLiveQuery() forgets PrefixMatchLevel
  • #583 getAllDocumentsQuery() ignores PrefixMatchLevel
  • #575 restart of a replication shouldn't hang if the replication is already stopped.
  • #563 Updating a document in a transaction block twice using Document.DocumentUpdater results in an infinite loop
  • #560 Using deleteIndex() on an unregistered View makes the View unusable
  • #497 Crash while building/rebuilding View
  • #472 Potential race condition in Document.update
  • #452 Error after close DB client
  • #427 P2P - SQLiteReadOnlyDatabaseException error
  • #413 NullPointerException in query with setGroupLevel() without reduce function and no data
  • #397 PushReplicator tries to push new document even though replicator is offline
  • #383 Pull replication not going back into IDLE state
  • #371 Android,replication algorithm 1.0.3 stalls before replicating all documents
  • #361 RemoteRequestCompletionBlock java.util.ConcurrentModificationException
  • #356 Replication restart problem
  • #353 Don't persist cookie without max-age or expires property
  • #352 Get session and checkpoint when retrying replications
  • #342 Changes performed offline don't sync when going online.
  • #296 NPE thrown when running ApiTest.testLiveQueryRun
  • #285 Null pointer exception because of failing to rebuild view
  • #61 Make / db names work in windows

Download

You can download this release from Couchbase.com

Gradle users should add the following line to the top-level dependency section to your app's build.gradle file:

compile 'com.couchbase.lite:couchbase-lite-java:1.1.0'

Please refer to Adding Couchbase Lite to your Gradle project for detailed information.

System Requirements

  • JDK 1.7+
Note: Couchbase Lite for Java relies on a small native code library used by the storage engine. We include the native libraries in the Couchbase Lite for Java Linux download, but users on Windows and OS X currently have to build this library themselves. Future releases will include them, but until them, the following table lists the tools need to build on each respective platform.
Operating System Tool Chain Notes
Linux GCC and G++ [Already included in the download]
Mac OSX GCC or Clang Install the Command Line Tools for Xcode.
Windows Visual C++ Install Visual Studio 2013 and later.

The complete build instructions are available on the Couchbase Lite for Java GitHub repository.

Support Statement

Version 1.0 was released in May, 2014. With this release of version 1.1, the support window for 1.0 expires in December 2015.

Release Release Date End of Life Date
1.0 May 2014 December 2015
1.1 June 2015

1.0.4, March 5, 2015


Some highlights from our latest quality release:

Features and Improvements

  • Added prefix matching via Query.prefixMatchLevel property, #302

Bug fixes

  • Fixed NPE
  • Added getDocIds() for Replication
  • Fixed StorageEngine issue caused by Android and Java Context
  • Improve retry behavior when failing to push a doc
  • Changed apache http module package name which is customized for CBL
  • Fixed PullReplication status
  • Fixed _bulk_get batch size and error handling
  • Improve error handling for checkpoint doc
  • Upgrade to gradle 2.1
  • Fixed /_session issue
  • Fixed ChangeTracker Error handling
  • Improved document update and delete operation performance

1.0.3.1, October 22, 2014


Hot fix to address a packaging issue, #308.

1.0.3, October 17, 2014


Some highlights from our latest quality release:

  • Restarting replications throwing NullPointerExceptions, #249
  • 409 Error on PUT checkpoint, #250
  • Batcher thread safety issue, #283
  • Puller: docs not inserted when some docs fail validation, #242

1.0.1, July 28, 2014


This is our first patch release for 1.0.0. A large number of the fixes that impacted Android are also incorporated into this release. There are no especial Java-only fixes for this particular patch.

1.0.0, May 21, 2014


This is our first official release for Couchbase Lite. A major change from our Beta releases and 1.0.0 is an expansion of our platform support, which includes a 1.0.0 ready version of "portable" Java libraries to support Linux-based app development. We've also made a lot of advancement in the performance stability of our Android and Java platform, created better parity for our authentication support, and enabled better logging for community debugging feedback. Simultaneously to this release, we have also published our first beta for our C# support in a collaborative effort with our partner, Xamarin.

Java shares a core set of libraries with our Android platform, and faces a similar set of known issues regarding performance that we are actively addressing. In particular, we are resolving replication issues with high bulk volumes of data between Java client and Server that show minute memory leaks.

We are also expanding our built library package offering. Today we offer 32-bit and 64-bit Linux support, suitable for building apps on platforms such as the Raspberry Pi. We are also looking into packaging for other desktop platforms and will be releasing them soon.