I am using the adapter scenario and now want to create some manager classes that share the connections. The manager classes must be able to share the connections, since I want to call mutiple manager classes within a single connection. I have seen some uable examples on the forums on how to share the adapter.
e.g. http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=2306
What i am curious about is, when do you create the adapter and when do you open and close the connection?
Let's say i have two classes UI1 and UI2 and four manager classes A, B, C and D. Pseudocode:
.. in some method of UI1 ...
A.Method1();
B.Method2();
.. in some method of UI2 ...
C.Method1();
// declarations manager classes
class A
{
Public void Method1()
{
...
D.Methodx();
...
}
}
class B
{
Public void Method2()
{
... implementation ...
}
}
class C
{
Public void Method1()
{
...
D.Methodx();
...
}
}
class D
{
Public void Methodx()
{
... implementation ...
}
}
At the moment i am tempted to say that the manager classes only participate in the transactions but may not be able to start or commit one. This will avoid unwanted side effects. One the other hand, I don't want to do anything with transactions in the PL. Does that mean that i have to create an extra (UI process) layer to solve this?
Thanks in advance,
Wouter