public Transaction createWritePrepareTransaction(Transaction transaction,
                                                     ApplicationId applicationId,
                                                     long sessionId,
                                                     Optional<Long> activeSessionId) {
        return database().createWritePrepareTransaction(transaction,
                                                        applicationId,
                                                        sessionId,
                                                        activeSessionId.map(OptionalLong::of).orElseGet(OptionalLong::empty));
    }
Returns a transaction which writes the given session id as the last deployed for the given application.

@param applicationId An {@link ApplicationId} that represents an active application.
@param sessionId session id belonging to the application package for this application id.
configserver/src/main/java/com/yahoo/vespa/config/server/application/TenantApplications.java