package za.sabob.olive.jdbc.config;

public class JDBCConfig {

    private static final ThreadLocal<Boolean> JOINABLE_TRANSACTIONS = new ThreadLocal<>();

    private static boolean JOINABLE_TRANSACTIONS_DEFAULT = true;

    public static void setJoinableTransactionsDefault( boolean value ) {
        JOINABLE_TRANSACTIONS_DEFAULT = value;
    }

    public static boolean isJoinableTransactionsDefault() {
        return JOINABLE_TRANSACTIONS_DEFAULT;
    }

    public static boolean setJoinableTransactions( boolean value ) {
        boolean currentValue = isJoinableTransactions();
        JOINABLE_TRANSACTIONS.set( value );
        return currentValue;
    }

    public static boolean isJoinableTransactions() {
        Boolean value = JOINABLE_TRANSACTIONS.get();
        if ( value == null ) {
            return isJoinableTransactionsDefault();
        }
        return value;

    }
}

@@ -30,16 +30,67 @@
 onfig;%0A%0A
+import javax.sql.*;%0Aimport za.sabob.olive.jdbc.*;%0A%0A
 public c
@@ -933,17 +933,231 @@
  value;%0A
-%0A
     %7D
+%0A%0A    public static DataSource getDefault() %7B%0A        return DSF.getDefault();%0A    %7D%0A%0A    public static void registerDefault( DataSource defaultDataSource ) %7B%0A        DSF.registerDefault( defaultDataSource );%0A    %7D%0A
 %0A%7D%0A

set default DS through JDBCConfig