General Application Design
Posted by: Frederic Laruelle
Date: February 23, 2005 04:01PM

Looking for the most efficient way to design a DB app from a memory usage and perfomance standpoint:

Assuming a pseudo structure like this:

class MyClass
{
public static void Main()
{
DoSomething();
DoAnotherThing();
}
public static void DoSomething()
{
...
}
public static void DoAnotherThing()
{
...
}
}

What would be the most efficient way to design this code if both DoSomething() and DoAnotherThing() need to execute independent SQL statements?

a) Would you open a DB connection in Main(), and then pass it as a parameter to the 2 methods? (versus opening a new connection in each method)
b) what about a SQL transaction, should this also be passed as a parameter?

Any comments appreciated.

Options: ReplyQuote


Subject
Written By
Posted
General Application Design
February 23, 2005 04:01PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.