We are writing some classed that will log some information to the database that we will use later to generate activity reports. Within a given transaction, there may be more than one activity occurring. For example, if you download a file, you must first access the file to download it. We would like to be able to link two activities (access and download) to the same transaction. Is there a way in JBoss or through the java sun core api's to obtain the transaction id so that we can log it along with the activity?