Creating new context for every document that comes in

Can someone tell what is the “Best Practice” for creating a new context (for DB access) when a service is invoked?

Is this with the B2B/Integration Server or Enterprise Server?

In the former is this using the WmDB package?