db access and base classes

G

Greg Lindstrom

Hello-

I am writing an application that uses a base class to help define multiple
record segments. Currently, there are 18 different segment types, with many
more to come. I would like to access a SQL Server to generate job info, id
numbers, etc. and would like to place the connection in the base class so
all segments use it via inheritance. My problem is I do not know how to set
things up so the connection is on opened once. I don't know which segment
will be generated first, so I can't base it off that. How can I set things
up so if the connection does not exist one will be opened, but if the
connection is open it will be used. Additionally, if segment "A" opens the
connection, then segment "B" invokes it, then segment "A" is destroyed, I
would like to hold the connection open until all segments are destroyed
(sounds like reference counting to me).

Can this be done, or am I simply trying to do something that is not
possible/desirable with my base class?

Thanks for your help and expertise,
--greg

Greg Lindstrom (501) 975-4859
NovaSys Health (e-mail address removed)

"We are the music makers, and we are the dreamers of dreams" W.W.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Sharing Base Class members 0
mySQL access 2
Sharing Base Class members 1
Oracle Access via cx_Oracle 0
Oracle Access via cx_Oracle 1
Oracle Access via cx_Oracle 1
Machine identification 1
Pmw EntryWidget Help 1

Top