SQLCipher(v) compatibility with openssl(v)

@developernotes @sjlombardo hello!
Migrating from 3.3.1 to 4.4.0

  1. https://github.com/couchbase/couchbase-lite-java-core/blob/master/src/main/java/com/couchbase/lite/storage/SQLiteStorageEngineBase.java#L128

Decrypt DB gets exception as sqlcipher is 4.4.0, after getting exception i am calling with old key and then call cipher_migrate but the return value is 1 .

 connection.execute("PRAGMA key = \"x'" + key.getHexData() + "'\"", null, null);

long cipherMigratValue = connection.executeForLong(“PRAGMA cipher_migrate”, null, null);
Log.d(“Sync”, "cipher_migrate value " + cipherMigratValue);
if(cipherMigratValue == 0){
Log.d(“Sync”, “cipher_migrate passed” );
connection.executeForLong(“SELECT count(*) FROM sqlite_master”, null, null);
}else{
Log.d(“Sync”, "cipher_migrate value failed " + cipherMigratValue);
throw new com.couchbase.lite.internal.database.SQLException();
}

1)Please suggest what are settings to be looked at?
2)SQLCipher API - Zetetic
" 1. If SQLCipher throws an error on first access, close the database handle. Then open it and run PRAGMA cipher_migrate (e.g. in the case of Android you can use the postKey hook). This will attempt to upgrade the database."

Elaborate more on " close the database handle"

Thanks
Nithin