Define a POCO Entry Point

On an originating tier, a POCO entry point is the method that starts the business transaction. If the POCO entry point is on a downstream tier, it may correlate to an upstream exit point. When defining a POCO entry point, it is important to choose a method that begins and ends every time the business transaction executes. See Business Transactions.

Good candidates for POCO entry points include the following:

  • A method in a socket application that executes every time a client connects.
  • A loop in a standalone application that batch processes records via a web service call. For example, an expense reporting system that loops through approved expenses to submit them for reimbursement.
  • A Windows service that regularly executes a database call to check for new jobs to process. In this example, the POCO entry point would be defined on the namespace JobProcessor, class JobProcessorCore and method ProcessJobs:
.NET
using System.Threading;
using System;
using System.Threading.Tasks;
using System.Configuration;
using System.Collections.Generic;
namespace JobProcessor {
class JobProcessorCore {
public void Process() {
while(running) {
ProcessJobs ();
// run jobs again after 1 minute
Thread.Sleep(60000);
}
}
private void ProcessJobs() {
var logic = new JobManagement ();
var jobs = logic.GetJobs(); // Query Database for a list of jobs to process
foreach (var job in jobs) {
logic.ExecuteJob(job); // logic for executing a job
}
}
}
}