public FBTpbMapper getMapper() throws FBResourceException {
    if (mapper != null) {
      return mapper;
    }

    if (tpbMapping == null) {
      mapper = FBTpbMapper.getDefaultMapper();
    } else {
      mapper = new FBTpbMapper(tpbMapping, getClass().getClassLoader());
    }

    mapper.setDefaultTransactionIsolation(defaultTransactionIsolation);

    for (Map.Entry<Integer, TransactionParameterBuffer> entry : customMapping.entrySet()) {
      Integer isolation = entry.getKey();
      TransactionParameterBuffer tpb = entry.getValue();

      mapper.setMapping(isolation, tpb);
    }

    return mapper;
  }
  public Object clone() {
    try {
      FBConnectionProperties clone = (FBConnectionProperties) super.clone();

      clone.properties = new HashMap<>(properties);
      clone.customMapping = new HashMap<>(customMapping);
      clone.mapper = mapper != null ? (FBTpbMapper) mapper.clone() : null;

      return clone;
    } catch (CloneNotSupportedException ex) {
      throw new Error("Assertion failure: clone not supported"); // Can't happen
    }
  }
 public void setTransactionParameters(int isolation, TransactionParameterBuffer tpb) {
   customMapping.put(isolation, tpb);
   if (mapper != null) {
     mapper.setMapping(isolation, tpb);
   }
 }
 public TransactionParameterBuffer getTransactionParameters(int isolation) {
   if (mapper != null) {
     return mapper.getMapping(isolation);
   }
   return customMapping.get(isolation);
 }
 public void setDefaultIsolation(String isolation) {
   setDefaultTransactionIsolation(FBTpbMapper.getTransactionIsolationLevel(isolation));
 }
 public String getDefaultIsolation() {
   return FBTpbMapper.getTransactionIsolationName(getDefaultTransactionIsolation());
 }
 public void setDefaultTransactionIsolation(int defaultIsolationLevel) {
   defaultTransactionIsolation = defaultIsolationLevel;
   if (mapper != null) {
     mapper.setDefaultTransactionIsolation(defaultIsolationLevel);
   }
 }
 public int getDefaultTransactionIsolation() {
   if (mapper != null) {
     return mapper.getDefaultTransactionIsolation();
   }
   return defaultTransactionIsolation;
 }