13.07.2015 Views

Using SQL Adapters with Ensemble - InterSystems Documentation

Using SQL Adapters with Ensemble - InterSystems Documentation

Using SQL Adapters with Ensemble - InterSystems Documentation

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Using</strong> the <strong>SQL</strong> Inbound Adapter2.2.1 Development TasksIn the <strong>Ensemble</strong> Studio, write and compile a new business service class. The following list describesthe basic requirements:• Your business service class should extend Ens.BusinessService.• In your class, the ADAPTER parameter should equal EnsLib.<strong>SQL</strong>.InboundAdapter.• Your class should implement the OnProcessInput method, as described in “Implementing theOnProcessInput Method.”• Your class can optionally implement any or all of the startup and teardown methods: OnInit,OnTearDown, OnProductionStart, and OnProductionStop. Most commonly, you customizeOnInit; see “Initializing the Adapter.”The following example shows the general structure that you need:Class E<strong>SQL</strong>.NewService1Extends Ens.BusinessService [ ProcedureBlock ]{Parameter ADAPTER = "EnsLib.<strong>SQL</strong>.InboundAdapter";Method OnProcessInput(pInput As EnsLib.<strong>SQL</strong>.Snapshot,pOutput As %RegisteredObject) As %Status{set tsc=$$$OK//your code hereQuit tsc}}Note:The <strong>Ensemble</strong> Studio provides a wizard that you can use to create a stub similar to the preceding.To access this wizard, click File —> New and then click the Production tab. Note thatthe wizard provides a generic input argument. If you use the wizard, <strong>InterSystems</strong> recommendsthat you edit the method signature to use the specific input argument needed <strong>with</strong> this adapter;the input argument type should be EnsLib.<strong>SQL</strong>.Snapshot.2.2.2 Configuration TasksTo add your business service to an <strong>Ensemble</strong> production, use the <strong>Ensemble</strong> Management Portal to dothe following:1. Add an instance of your custom business service class to the <strong>Ensemble</strong> production.2. Enable the business service.3. Set the PoolSize setting to 1.If PoolSize is larger than 1, the adapter will process many records twice.8 <strong>Using</strong> <strong>SQL</strong> <strong>Adapters</strong> <strong>with</strong> <strong>Ensemble</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!