Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 13 total
Thread Triggers and Users
Thu, Apr 16 2009 5:04 AMPermanent Link

Heiko Knuettel
Hi !

I want to log changes on a table. Whenever a field is updated, a new record should be
created in a log table, that contains what has been changed, when, and by whom.

The latter is the problem. I'm using C/S and every client connects to the server as the
same EDB user, the user management is done by the application. So only the client knows,
which user is logged on at the moment.

I can't change that, because I need the ability to change the username while the session
stays connected.

Can someone think of a way to access my application username from inside a trigger ?

If there would be something like CURRENT_SESSIONID, I could update a
SessionID-Username-Table whenever the application changes the username, and lookup the
username from that table...

Heiko
Thu, Apr 16 2009 5:25 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Heiko,

<< The latter is the problem. I'm using C/S and every client connects to the
server as the same EDB user, the user management is done by the application.
So only the client knows, which user is logged on at the moment.

I can't change that, because I need the ability to change the username
while the session stays connected.

Can someone think of a way to access my application username from inside a
trigger ? >>

Hmm, that's a tough one.  Are the user names guaranteed to be unique, or
would it be possible to have two different sessions using the same
application-controlled user name ?

--
Tim Young
Elevate Software
www.elevatesoft.com

Thu, Apr 16 2009 6:20 PMPermanent Link

Heiko Knuettel
Tim,

>>Are the user names guaranteed to be unique

No. One user can log in on as many clients as he wants. So yes,

>>would it be possible to have two different sessions using the same
application-controlled user name ?

that's possible.

Heiko
Thu, Apr 16 2009 8:31 PMPermanent Link

Shane Stump
Tim,

Does ElevateDB support session variables? I have a similar problem and I use several
"session" variables in a logging system I wrote for NexusDB. Since NexusDB supports
session variables, it hasn't been an issue.

Best Regards,

Shane
Fri, Apr 17 2009 1:52 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Heiko,

<< No. One user can log in on as many clients as he wants. So yes, >>

Okay, so putting the user name by itself in the session name
(TEDBSession.SessionName) is out.  I'll have to do some more thinking on
this.

--
Tim Young
Elevate Software
www.elevatesoft.com

Fri, Apr 17 2009 1:56 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Shane,

<< Does ElevateDB support session variables? I have a similar problem and I
use several"session" variables in a logging system I wrote for NexusDB.
Since NexusDB supports session variables, it hasn't been an issue. >>

No, but that's a good idea.  I'll see about implementing it in EDB.

--
Tim Young
Elevate Software
www.elevatesoft.com

Fri, Apr 17 2009 2:03 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Heiko,

Just a quick thought - how about if you were to just use a temporary table
for storing this information ?  You could just create the temporary table at
the start of each session, and then it would be accessible for the duration
of the session.  Just remember to drop the table before the session
disconnect.

--
Tim Young
Elevate Software
www.elevatesoft.com

Fri, Apr 17 2009 4:54 PMPermanent Link

Heiko Knuettel
Tim,

>>how about if you were to just use a temporary table for storing this information ?

I'll try this, it sounds good. I wasn't aware that a trigger can access session specific
temporary tables.

>>Just remember to drop the table before the session disconnect.

In case of    unexpectedly terminated sessions, will the EDB server delete the temporary
table files after a while ? Or, if not, can I identify (distinguish between temporary
tables that are currently in use) and delete them myself ?

Thanks very much !!

Heiko
Fri, Apr 17 2009 6:27 PMPermanent Link

"Terry Swiers"
Tim,

> No, but that's a good idea.  I'll see about implementing it in EDB.

I would like to also put my name behind this request.  Since we do a whole
lot of updates via triggers, having a session variable that would allow us
to track who initiated the trigger would be absolutely fantastic.

--

---------------------------------------
 Terry Swiers
 Millennium Software, Inc.
 http://www.1000years.com
 http://www.atrex.com

 Atrex Inventory Control/POS -
    Big business features without spending big business bucks!

Atrex Electronic Support Options:
 Atrex Knowledgebase: http://www.atrex.com/atrexkb.asp
 Email: mailto:support@atrex.com
 Newsgroup: news://news.1000years.com/millennium.atrex
 Fax: 1-925-829-1851
 Phone: 1-925-828-5892 (M-F, 9a-5p Pacific)
 ---------------------------------------

Sat, Apr 18 2009 10:53 AMPermanent Link

Shane Stump
Tim,

The idea of a "session" table for each connection would work for me!

Quick question: if the user program disconnected unexpectedly, wouldn't the server
automatically delete the session tables when it determined the session (connection) was no
longer valid?

Best Regards,

Shane

P.S. ElevateDB keeps sounding better and better!!
Page 1 of 2Next Page »
Jump to Page:  1 2
Image