I have an application the performs a routine with some Data. Theres a lot of data to process, so I have that same application running several times, on the same computer ( 2 quadcore processors) , and in other computers as well, all accessing the same database.
All application instances write a log to a log table in the database, and I need to tell witch application instance wrote each log record.
So in general, the question is:
How do I assign an unique ID to an application instance when it starts? Right now, I have 21 instances running on 6 different computers.
And even better, how do I control these applications in a centralized way? Like, how to know how many are running (sometimes they hang) , what computer they are running from, and how to send commands to them (like stop, start, etc).
Any ideas will be greatly appreciated
add 2 fields to the log table (username can be null and computername can be null)
write a insert trigger on the log table
in the trigger you can then alter the username and computername before inserting the record
implementation depends on database type like oracle or mssql