Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Inheritence and Sessions
Tue, Nov 4 2008 2:19 PMPermanent Link

Daniel Kram
Forgive me if I do not explain this well.
I am a newbie to Elevate but not new to Delphi.
Still using Trial version of Elevate DB 2.0 with Delphi 2007 Windows XP

I have a base class, DBClass, and in here is very generic code dealing with configuration to my remote DB server and virtual methods and so
forth.

Then, in other units - usually one per table, I put in my logic dealing with this particular table.

When I want to work with a table, I instantiate the class I wish to work with and he in turn calls his parent, DBClass.
In DBClass, I set a SessionName to the user and the current timestamp of the system.
I am wondering if this is the best way?
If I try to instantiate one DBClass object at startup with one session name and point my child objects of DBClass to the same SessionName, I
receive an error the SessionName is already in use – because there is only one of them – on DBClass object.
Sorry for not explaining it well.
Basically, I want to be able to have one session object and point all my tables to it – is this possible?
Tue, Nov 4 2008 3:49 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Daniel,

<< I have a base class, DBClass, and in here is very generic code dealing
with configuration to my remote DB server and virtual methods and so forth.

Then, in other units - usually one per table, I put in my logic dealing
with this particular table.

When I want to work with a table, I instantiate the class I wish to work
with and he in turn calls his parent, DBClass.
In DBClass, I set a SessionName to the user and the current timestamp of
the system. I am wondering if this is the best way? If I try to instantiate
one DBClass object at startup with one session name and point my child
objects of DBClass to the same SessionName, I receive an error the
SessionName is already in use – because there is only one of them – on
DBClass object.Sorry for not explaining it well.
Basically, I want to be able to have one session object and point all my
tables to it – is this possible? >>

Sure, just setting the SessionName property of any TEDB* components to the
same as the TEDBSession component (also SessionName property) that you're
using will do the trick.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image