Skip to content

Commit

Permalink
issue #380, #270
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Bastide <pbastide@us.ibm.com>
  • Loading branch information
prb112 committed Jan 29, 2020
1 parent 6bc05a5 commit 10e8936
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ public void createTenantPartitions(Collection<Table> tables, String schemaName,
// try to create the actual partitions
final String tablespaceName = "TS_TENANT" + newTenantId;
try (ITransaction tx =
(TransactionFactory.getTransaction() != null) ?
TransactionFactory.getTransaction()
(TransactionFactory.getTransaction(true) != null) ?
TransactionFactory.getTransaction(true)
: TransactionFactory.openTransaction(connectionProvider);) {
try {
logger.info("Creating tablespace: " + tablespaceName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,12 @@ private ITransaction openTransactionForThread(IConnectionProvider cp) {
* @throws IllegalStateException if no transaction is open
*/
public static ITransaction getTransaction() {
return getTransaction(false);
}

public static ITransaction getTransaction(boolean override) {
ITransaction result = getInstance().getTransactionForThread();
if (result == null) {
if (!override && result == null) {
throw new IllegalStateException("No transaction is open");
}
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ public UpdateTenantStatusAction() {
public void run(ActionBean actionBean, IDatabaseTarget target, IDatabaseAdapter adapter,
ITransactionProvider transactionProvider) throws SchemaActionException {
adapter.updateTenantStatus(actionBean.getAdminSchemaName(), actionBean.getTenantId(), actionBean.getStatus());
logger.info("Update Tenant Status: " + actionBean.getTenantName() + "] " + actionBean.getStatus());
logger.info("Update Tenant Status: [" + actionBean.getTenantName() + "] " + actionBean.getStatus());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* (C) Copyright IBM Corp. 2020
*
* SPDX-License-Identifier: Apache-2.0
*/

package com.ibm.fhir.schema.app.test.main;

import com.ibm.fhir.schema.app.Main;
import com.ibm.fhir.schema.app.test.main.helper.TestHelper;

public class UpdateProcMain {
public static void main(String[] args) {
String[] arguments = {
"--prop-file", TestHelper.absolutePathToProperties(),
"--pool-size", "5",
"--schema-name", "FHIRDATA1",
"--update-proc", "default2"
};
Main.main(arguments);
}
}

0 comments on commit 10e8936

Please sign in to comment.