Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 18 total
Thread EDB and Sessions
Wed, Mar 1 2017 9:10 AMPermanent Link

rbaroniunas

Baron Software

Avatar

Being a newbie to the EDB I just want to make sure i am clear on preparing the system.

Do i create a separate session for each database that pertains to the application I am writing or just one session ?
Each Application has a distinct database that will be deployed with the package and for some cases will be a single user.  Is this the appropriate way of doing things ?

Also on the publishing database, do I have to do that after I have completed writing the application ?

Richard Baroniunas
Software Developer and DBA
Richard@Baronsoftware.com
Wed, Mar 1 2017 9:54 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

rbaroniunas


>Being a newbie to the EDB I just want to make sure i am clear on preparing the system.
>
>Do i create a separate session for each database that pertains to the application I am writing or just one session ?
>Each Application has a distinct database that will be deployed with the package and for some cases will be a single user. Is this the appropriate way of doing things ?

Its a bit awkward to answer. A lot will depend on your application.

In broad terms the session is a mechanism for maintaining separation between databases (and hence tables) so if you want to use SQL to update things in a database from the contents of another database keep them in the same session. The only really good reason I have to use multiple sessions in an application is for isolation in  threads. There you ALWAYS want a separate session.

>Also on the publishing database, do I have to do that after I have completed writing the application ?

If you already know you want to publish all or part of the database you should set things up as part of developing the application, but it can be changed at any time. You need to think about why as much as what.

Roy
Wed, Mar 1 2017 10:36 AMPermanent Link

rbaroniunas

Baron Software

Avatar

Thanks Roy, let me try to get a clearer picture of what I do.

Let's say I have 3 separate applications that I sell in which case are single user database applications.

if i plan in deploying the application to multiple end users/clients:

Should i have a separate session for the purpose of deployment and keeping separate admin/passwords ?

OR

Just keep the default session with the admin/password and upon deployment send that with the package ?

Richard Baroniunas
Software Developer and DBA
Richard@Baronsoftware.com
Wed, Mar 1 2017 10:47 AMPermanent Link

Matthew Jones

Sounds like you are talking about the Sessions in EDB Manager, rather than in your applications. If so, you want a separate session for each application, assuming of course they are not actually going to be using the same tables. So from a "system admin" point of view, you personally can have easy access to all the databases you work with. THe applications (and end users) will only have access to the single session.

From a deployment point of view, look back at my questions on how to deploy, where you get very thorough answers on how and what and why, as I was quite confused! 8-)


--

Matthew Jones
Wed, Mar 1 2017 11:00 AMPermanent Link

rbaroniunas

Baron Software

Avatar

Thanks for the additional information.  I am going to review what you put on the support prior to this to look at the best solution.

One other question, how do you copy tables between databases or do i have to just execute a SQL Create Table ?

Richard Baroniunas
Software Developer and DBA
Richard@Baronsoftware.com
Wed, Mar 1 2017 11:23 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Richard


There are (at least) two ways I can interpret what you're asking:

1. you plan on selling the application and it will run on your customers computers
2. you plan on selling access to the application and it will run on your computers

There is a lot of difference between the two from a management perspective.

You could also be asking how to arrange EDBManager to allow you to support your customers via option 1 above.

So here goes as best as I can.

>Let's say I have 3 separate applications that I sell in which case are single user database applications.

Each of the three applications will have its own instance of EDBEngine, EDBSession & EDBDatabase IE if they are separate applications, whilst it would be technically possible to have separate instances of them it would not be sensible. Ultimately the sessions could link with databases which represent the same set of tables. If that is the case you'll need to be careful that each session points to the same config file otherwise you'll have sharing problems.

>if i plan in deploying the application to multiple end users/clients:
>
>Should i have a separate session for the purpose of deployment and keeping separate admin/passwords ?

This is down to how you want to control things. I tend to have two approches. The first is where I don't care who sees or manipulates the data and there I go with the built in defaults. For the others I build into my applications the ability for users to set up their own passwords, users etc. In my recruitment application since it involves personal data I built in the ability for users to alter the encryption key. I also use a none standard engine signature.

I would recommend singe instances of  EDBEngine (this is mandatory), EDBSession & EDBDatabase per application, deploy initially with a default (either Elevate's or youw own) and give users the option of changing them.

You might also be looking at using this as a way of licence protection for your application. I wouldn't.

Roy Lambert
Wed, Mar 1 2017 11:29 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Richard

>One other question, how do you copy tables between databases or do i have to just execute a SQL Create Table ?

Are you talking tables when they have been populated or the definitions ie the metadata.

If the former then it depends if they are identical as to version - simple dos level copy will work - or not in which case you can use reverse engineering in EDBManager to create sql to do the job.

If its the metadata then if only one table I'd use EDBManager to reverse engineer without data and run the sql generated. If its all the tables then you need to copy the catalog and point the new session (config file) at the catalog you've just copied.

Roy Lambert
Thu, Mar 2 2017 4:08 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Richard,

<< Do i create a separate session for each database that pertains to the application I am writing or just one session ? >>

I think you're referring to ElevateDB Manager sessions here.  In your application, a session is simply the existence of a TEDBSession component.  In the EDB Manager, the EDB Manager provides the persistence of session information, hence the appearance of the "creation" of sessions.  However, in practice this is only a "sleight-of-hand" provided by the EDB Manager, and sessions are really just an in-memory construct that are used to isolate access among multiple threads, as well as provide the ability to access multiple configuration files from within the same application.

If you want to see how all of this should be handled in an actual application, please check out the CDCollector example application that ships with ElevateDB.  You will find it in this directory:

<InstallDir>\examples\cdcollector

or

<InstallDir>\examples\cdcollectorunicode (uses Unicode configuration/databases)

If you don't have a lot of need for the user security in ElevateDB, and other features that persist in the configuration files like stores, then you can also use an in-memory configuration:

http://www.elevatesoft.com/manual?action=viewprop&id=edb2&product=rsdelphiwin32&version=10B&comp=TEDBEngine&prop=ConfigMemory

This means that the only on-disk files needed are your database catalog/table files.  It's very nice in terms of keeping things simpler to deal with.  Just be sure to read the caveats in that link.

<< Also on the publishing database, do I have to do that after I have completed writing the application ? >>

By "publishing", do you mean replication ?

Tim Young
Elevate Software
www.elevatesoft.com
Thu, Mar 2 2017 5:36 PMPermanent Link

rbaroniunas

Baron Software

Avatar

After a lot of feedback on the sessions let's go with what i am trying to do.

Single user with EDB database and deployment.

1. There should be a single session with that single user.  So that means when i develop the application i want to have  single username / password.
2. How do you stop the user login dialog from popping up.
3. Do i create a separate session in the EDB manager to handle this ?
4. Deployment of an application like this, one application, single user to access the database.

Richard Baroniunas
Software Developer and DBA
Richard@Baronsoftware.com
Fri, Mar 3 2017 3:31 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Richard


I'm going to try and answer your questions but you might want to read the manual.


>1. There should be a single session with that single user. So that means when i develop the application i want to have single username / password.

ElevateDB is a multi-user database. Naturally, it can handle single user applications, but, its your responsibility to handle access. There are a number of ways of doing it:

a) set a key table (or all tables) to exclusive access
b) monitor user logins and abort after one
c) monitor sessions (need c/s for this)
d) set a table lock - have a look in the extensions ng for a mechanism for a "soft lock"
e) write an entry into the registry
etc
etc

>2. How do you stop the user login dialog from popping up.

Where? In EDBManager - set the user name and password on the login page for the session. In an application set the details (LoginUser, LoginPassword) in the session

>3. Do i create a separate session in the EDB manager to handle this ?

Not sure what you want to handle here. YIt probably is for the best to create a session in EDBManager for each application for testing purposes if nothing else.

>4. Deployment of an application like this, one application, single user to access the database.

You need to tell us what deployment means in your case. I'm guessing send a program to a user and allow them to get on with it. If so then you have two options:

a) put all the code needed to create tables etc into the application, check for their existence on start up and if not there create things either in a standard directory (eg APPDATA\yourapp)
b) distribute config, catalog, and some or all tables with/without data.  If you allow the user to choose where to put it you'll have to alter paths in the application at start up (the demo Tim gives out shows how this works)

Roy Lambert
Page 1 of 2Next Page »
Jump to Page:  1 2
Image