/** * Build and return the EIS accessorr. */ public Accessor buildAccessor() { return new EISAccessor(); }
/** * Avoid super to have logging occur after possible manual auto-commit. */ public Object executeCall(Call call, AbstractRecord translationRow, AbstractSession session) throws DatabaseException { return basicExecuteCall(call, translationRow, session); }
/** * Return the CCI connection to the EIS resource adapter. */ public Connection getCCIConnection() { return (Connection)getDatasourceConnection(); }
if (getLogin() == null) { throw DatabaseException.databaseAccessorNotConnected(); boolean autoCommit = (!isInTransaction()) && getEISPlatform().requiresAutoCommit(); if (autoCommit) { beginTransaction(session); incrementCallCount(session); session.startOperationProfile(SessionProfiler.SqlPrepare, eisCall.getQuery(), SessionProfiler.ALL); Record input = null; Record output = null; try { interaction = getCCIConnection().createInteraction(); input = getEISPlatform().createInputRecord(eisCall, this); output = getEISPlatform().createOutputRecord(eisCall, translationRow, this); } finally { session.endOperationProfile(SessionProfiler.SqlPrepare, eisCall.getQuery(), SessionProfiler.ALL); try { boolean success = true; InteractionSpec interactionSpec = getEISPlatform().buildInteractionSpec(eisCall); if (output == null) { output = interaction.execute(interactionSpec, input); AbstractRecord outputRow = getEISPlatform().buildRow(output, eisCall, this); if (outputRow != null) { eisCall.getQuery().setProperty("output", outputRow); result = getEISPlatform().buildRow(output, eisCall, this);
/** * Begin a local transaction. */ protected void basicBeginTransaction(AbstractSession session) throws EISException { try { if (getEISPlatform().supportsLocalTransactions()) { getCCIConnection().getLocalTransaction().begin(); } } catch (ResourceException exception) { throw EISException.resourceException(exception, this, session); } }
recordName = valuesRow.getFields().get(0).getTableName(); MappedRecord record = accessor.getRecordFactory().createMappedRecord(recordName); for (Iterator keysIterator = valuesRow.getFields().iterator(); keysIterator.hasNext();) { DatabaseField field = (DatabaseField)keysIterator.next(); Object elementValue = createRecordElement(field.getName(), valuesRow.get(field), accessor); accessor.getEISPlatform().setValueInRecord(field.getName(), elementValue, record, accessor);
/** * Allow the platform to handle the creation of the DOM record. * By default create a mapped record an assume it implements DOM as well. */ public Record createDOMRecord(String recordName, EISAccessor accessor) { try { return accessor.getRecordFactory().createMappedRecord(recordName); } catch (ResourceException exception) { throw EISException.resourceException(exception, accessor, null); } }
/** * Build a collection of database rows from the Record returned from the interaction. */ public Vector buildRows(Record record, EISAccessor accessor) { Vector rows = null; if (record == null) { return new Vector(0); } AbstractRecord row = accessor.getEISPlatform().createDatabaseRowFromDOMRecord(record, this, accessor); if (getOutputResultPath().length() > 0) { Vector values = (Vector)row.getValues(getOutputResultPath()); if (values == null) { values = new Vector(0); } rows = values; } else { rows = new Vector(1); rows.add(row); } return rows; }
/** * Close the connection. */ @Override protected void closeDatasourceConnection() { try { getCCIConnection().close(); } catch (ResourceException exception) { throw EISException.resourceException(exception, this, null); } }
/** * Return and cast the platform. */ public EISPlatform getEISPlatform() { return (EISPlatform)getDatasourcePlatform(); }
if (getLogin() == null) { throw DatabaseException.databaseAccessorNotConnected(); boolean autoCommit = (!isInTransaction()) && getEISPlatform().requiresAutoCommit(); if (autoCommit) { beginTransaction(session); incrementCallCount(session); session.startOperationProfile(SessionProfiler.SqlPrepare, eisCall.getQuery(), SessionProfiler.ALL); Record input = null; Record output = null; try { interaction = getCCIConnection().createInteraction(); input = getEISPlatform().createInputRecord(eisCall, this); output = getEISPlatform().createOutputRecord(eisCall, translationRow, this); } finally { session.endOperationProfile(SessionProfiler.SqlPrepare, eisCall.getQuery(), SessionProfiler.ALL); try { boolean success = true; InteractionSpec interactionSpec = getEISPlatform().buildInteractionSpec(eisCall); if (output == null) { output = interaction.execute(interactionSpec, input); AbstractRecord outputRow = getEISPlatform().buildRow(output, eisCall, this); if (outputRow != null) { eisCall.getQuery().setProperty("output", outputRow); result = getEISPlatform().buildRow(output, eisCall, this);
/** * Rollback the local transaction on the datasource. */ public void basicRollbackTransaction(AbstractSession session) throws DatabaseException { try { if (getEISPlatform().supportsLocalTransactions()) { getCCIConnection().getLocalTransaction().rollback(); } } catch (ResourceException exception) { throw EISException.resourceException(exception, this, session); } }
recordName = ((DatabaseField)valuesRow.getFields().get(0)).getTableName(); MappedRecord record = accessor.getRecordFactory().createMappedRecord(recordName); for (Iterator keysIterator = valuesRow.getFields().iterator(); keysIterator.hasNext();) { DatabaseField field = (DatabaseField)keysIterator.next(); Object elementValue = createRecordElement(field.getName(), valuesRow.get(field), accessor); accessor.getEISPlatform().setValueInRecord(field.getName(), elementValue, record, accessor);
/** * Allow the platform to handle the creation of the DOM record. * By default create a mapped record an assume it implements DOM as well. */ public Record createDOMRecord(String recordName, EISAccessor accessor) { try { return accessor.getRecordFactory().createMappedRecord(recordName); } catch (ResourceException exception) { throw EISException.resourceException(exception, accessor, null); } }
/** * Build a collection of database rows from the Record returned from the interaction. */ public Vector buildRows(Record record, EISAccessor accessor) { Vector rows = null; if (record == null) { return new Vector(0); } AbstractRecord row = accessor.getEISPlatform().createDatabaseRowFromDOMRecord(record, this, accessor); if (getOutputResultPath().length() > 0) { Vector values = (Vector)row.getValues(getOutputResultPath()); if (values == null) { values = new Vector(0); } rows = values; } else { rows = new Vector(1); rows.add(row); } return rows; }
/** * Close the connection. */ protected void closeDatasourceConnection() { try { getCCIConnection().close(); } catch (ResourceException exception) { throw EISException.resourceException(exception, this, null); } }
/** * Return and cast the platform. */ public EISPlatform getEISPlatform() { return (EISPlatform)getDatasourcePlatform(); }
if (getLogin() == null) { throw DatabaseException.databaseAccessorNotConnected(); boolean autoCommit = (!isInTransaction()) && getEISPlatform().requiresAutoCommit(); if (autoCommit) { beginTransaction(session); incrementCallCount(session); session.startOperationProfile(SessionProfiler.SQL_PREPARE, eisCall.getQuery(), SessionProfiler.ALL); Record input = null; Record output = null; try { interaction = getCCIConnection().createInteraction(); input = getEISPlatform().createInputRecord(eisCall, this); output = getEISPlatform().createOutputRecord(eisCall, this); } finally { session.endOperationProfile(SessionProfiler.SQL_PREPARE, eisCall.getQuery(), SessionProfiler.ALL); InteractionSpec interactionSpec = getEISPlatform().buildInteractionSpec(eisCall); if (output == null) { output = interaction.execute(interactionSpec, input); AbstractRecord outputRow = getEISPlatform().buildRow(output, eisCall, this); if (outputRow != null) { eisCall.getQuery().setProperty("output", outputRow); result = getEISPlatform().buildRow(output, eisCall, this); } else { result = getEISPlatform().buildRows(output, eisCall, this);
/** * Commit the local transaction. */ protected void basicCommitTransaction(AbstractSession session) throws EISException { try { if (getEISPlatform().supportsLocalTransactions()) { getCCIConnection().getLocalTransaction().commit(); } } catch (ResourceException exception) { throw EISException.resourceException(exception, this, session); } }
recordName = valuesRow.getFields().get(0).getTableName(); MappedRecord record = accessor.getRecordFactory().createMappedRecord(recordName); for (Iterator keysIterator = valuesRow.getFields().iterator(); keysIterator.hasNext();) { DatabaseField field = (DatabaseField)keysIterator.next(); Object elementValue = createRecordElement(field.getName(), valuesRow.get(field), accessor); accessor.getEISPlatform().setValueInRecord(field.getName(), elementValue, record, accessor);