Subject RE: [firebird-support] Re: The only user
Author Gustavo
Well, I didn't expected such a reaction to my idea!

My generator is not a primary key. What I am trying to do is the following.

I am migrating an application which originally used DBF tables and used a lot of temporary tables. I know this is is not a good practice but to accelerate the migration, now in the new version I'm developping in FireBird, I'm using a temporary database in the server and every client PC creates its temporary tables there (I first tried using the temporary database locally in the client PC but I can't use fbembed because I need more than one application to access the same database). Each instance of the application, when it starts, gets the number of the generator and names its tables in the temporary database using this number as an identifier followed by a "_" and correlative numbers. As there are many temporary tables and there may be a lot of users during the day but no user during the night, what I wanted to do was that the first that starts the application in a new day resets the generator and so the generator wont increase forever. I know 2 ^ 31 is a big number but anyway I wanted to to prevent...

I also thought using another identifier but the user may be duplicated and the PC name too. I consider there may occur that an instance of the application didn't finalize normally and some temporary tables remain in the temporary database and so there may be conflict between the tables of an instance and the tables created by the same PC the day before if there is some that wasn't deleted.

May be my idea is a bit foolish, but anyway... is there a way to do this?

Gustavo
----- Mensaje original -----
De: Alan McDonald
Para: firebird-support@yahoogroups.com
Enviado: Lunes, 18 de Julio de 2005 10:33
Asunto: RE: [firebird-support] Re: The only user


>
> We should offer a prize for the best suggestion as to why someone
> would do this!
>
> Dave

it's obviously not an important generator. not something to use as a primary
key - just something to start today's counting off. right?

Well if you connect with different names (i.e. each user logs on as a server
validated separate user), then IBX's admin components can tell you a list of
users. But I'm not sure it reliable. Can you be sure that your application
makes only one connection while active? no threads? no additional
connections? with the same credentials?

Alan


>
> --- In firebird-support@yahoogroups.com, "Alan McDonald" <alan@m...>
> wrote:
> > > Hello:
> > >
> > > I work with Delphi 5, IBX and FireBird.
> > >
> > > I have a database which has a generator. I want that each time a
> > > user connects to the database, if at that moment, he is the only
> > > user connected, then it resets the generator.
> > >
> > > Is there a way to check if a user is the only user connected to a
> > > database?
> > >
> > > Thanks in advance
> > >
> > > Gustavo
> >
> > and please tell us what havoc and disaster you are determined to achieve
> > from this little mischief?
> > Alan




++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://firebird.sourceforge.net and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !

Also search the knowledgebases at http://www.ibphoenix.com

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++




------------------------------------------------------------------------------
YAHOO! GROUPS LINKS

a.. Visit your group "firebird-support" on the web.

b.. To unsubscribe from this group, send an email to:
firebird-support-unsubscribe@yahoogroups.com

c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


------------------------------------------------------------------------------




[Non-text portions of this message have been removed]