(Trans)action ID to group records

O

Onno

Hi, I have a VB.NET app that writes 'usage logging' to an Access DB
via OleDb. There are applications all over the plant that log to the
same DB, so we can have a bit of insight in how the application is
being used. Some logged actions are a single entry ("user did this or
that"), others actions belong together ("user started action x" /
"user ended action x"). Not all start actions that should have a stop
action do so; user can abort, app can terminate, network can fail,
etc.

Right now, I am having a bit of trouble finding out which start/end
actions belong together. I do this on other parameters (IP address,
user name, etc) that I also log. It works, but is cumbersome.

A better way would be to give a 'transaction' ID to each action
logged, and let the app remember this and use the same transaction ID
for the end call. I could use an empty table with an auto-increment
field to generate unique transaction ID's.

Is this the preferred way? Does Access or VB.NET offer some methods
for this or do I have to implement it myself?

Thanks in advance,
Onno
 
S

Stefan Hoffmann

hi,
A better way would be to give a 'transaction' ID to each action
logged, and let the app remember this and use the same transaction ID
for the end call. I could use an empty table with an auto-increment
field to generate unique transaction ID's.
Use an GUID to identify your actions, field type replication id or
string, let the application create it per action/workflow.


mfG
--> stefan <--
 
O

Onno

hi,


Use an GUID to identify your actions, field type replication id or
string, let the application create it per action/workflow.

mfG
--> stefan <--

Thanks for your answer. I am not sure as why this would be better than
using a table in Access to create ID's? (2 GUID's could be the same,
although very little chance).

I would use something like Guid.NewGui() to create it and store it in
text field of 36 characters, right?

Thanks again.
 
S

Stefan Hoffmann

hi,
Thanks for your answer. I am not sure as why this would be better than
using a table in Access to create ID's? (2 GUID's could be the same,
although very little chance).
I would rely onto the uniqueness of a GUID. I think it's better, because
otherwise you have think about how to persist actions/workflow
definitions in your database. I don't think that is what you want. Also
reduces the local GUID creation network traffic. Minor points, but worth
the consideration.
I would use something like Guid.NewGui() to create it and store it in
text field of 36 characters, right?
Yes.


mfG
--> stefan <--
 
O

Onno

hi,


I would rely onto the uniqueness of a GUID. I think it's better, because
otherwise you have think about how to persist actions/workflow
definitions in your database. I don't think that is what you want. Also
reduces the local GUID creation network traffic. Minor points, but worth
  the consideration.


Yes.

mfG
--> stefan <--

Ok, I will try that. Thanks!
Onno
 

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

Top