| Transaction logging [message #780780] |
Thu, 19 January 2012 06:03  |
Thomas Messages: 9 Registered: December 2011 |
Junior Member |
|
|
Hi,
I want to log each transaction in the following way:
For each entity inserted/deleted/updated between transaction.begin() and transaction.commit() a transaction-id should be written both into the history table corresponding to the changed entity and into a "transaction-log-table". An entry in the transaction-log-table should also include e.g. a list (as string) of the tables/entities involved in the transaction.
I have already created a history customizer but have no idea how to handle the transaction (not entity) specific logging.
Any help would be very appreciated!
Thomas
|
|
|
|
| Re: Transaction logging [message #780847 is a reply to message #780841] |
Thu, 19 January 2012 10:47   |
Thomas Messages: 9 Registered: December 2011 |
Junior Member |
|
|
Hi James,
thanks for your answer. I thought of this too but the following questions arise:
How to ensure a "transaction-log entity" is created and persisted with every transaction? Is it possible to listen to transaction "events" (something like @PreCommit) or do I have to write something like for example a transaction decorator which handles the additional steps on commit (and furthermore an entitymanager which delivers such a decorated transaction on getTransaction())? My goal is to hide the details of this transaction logging from a user of the entitymanager.
How to determine the entities/tables affected by the actual transaction so this information can be stored within the transaction-log entity?
How to write the transaction id into the (from history policy) newly created row within the particular history table of each other entity changed in the actual transaction?
Best regards
Thomas
|
|
|
|
| Re: Transaction logging [message #781003 is a reply to message #781002] |
Thu, 19 January 2012 10:47  |
Thomas Messages: 151 Registered: July 2009 |
Senior Member |
|
|
Hi James,
thanks for your answer. I thought of this too but the following questions arise:
How to ensure a "transaction-log entity" is created and persisted with every transaction? Is it possible to listen to transaction "events" (something like @PreCommit) or do I have to write something like for example a transaction decorator which handles the additional steps on commit (and furthermore an entitymanager which delivers such a decorated transaction on getTransaction())? My goal is to hide the details of this transaction logging from a user of the entitymanager.
How to determine the entities/tables affected by the actual transaction so this information can be stored within the transaction-log entity?
How to write the transaction id into the (from history policy) newly created row within the particular history table of each other entity changed in the actual transaction?
Best regards
Thomas
|
|
|
|
| Re: Transaction logging [message #781020 is a reply to message #781002] |
Thu, 19 January 2012 10:47  |
Thomas Messages: 151 Registered: July 2009 |
Senior Member |
|
|
Hi James,
thanks for your answer. I thought of this too but the following questions arise:
How to ensure a "transaction-log entity" is created and persisted with every transaction? Is it possible to listen to transaction "events" (something like @PreCommit) or do I have to write something like for example a transaction decorator which handles the additional steps on commit (and furthermore an entitymanager which delivers such a decorated transaction on getTransaction())? My goal is to hide the details of this transaction logging from a user of the entitymanager.
How to determine the entities/tables affected by the actual transaction so this information can be stored within the transaction-log entity?
How to write the transaction id into the (from history policy) newly created row within the particular history table of each other entity changed in the actual transaction?
Best regards
Thomas
|
|
|
|
| Re: Transaction logging [message #781037 is a reply to message #781002] |
Thu, 19 January 2012 10:47  |
Thomas Messages: 151 Registered: July 2009 |
Senior Member |
|
|
Hi James,
thanks for your answer. I thought of this too but the following questions arise:
How to ensure a "transaction-log entity" is created and persisted with every transaction? Is it possible to listen to transaction "events" (something like @PreCommit) or do I have to write something like for example a transaction decorator which handles the additional steps on commit (and furthermore an entitymanager which delivers such a decorated transaction on getTransaction())? My goal is to hide the details of this transaction logging from a user of the entitymanager.
How to determine the entities/tables affected by the actual transaction so this information can be stored within the transaction-log entity?
How to write the transaction id into the (from history policy) newly created row within the particular history table of each other entity changed in the actual transaction?
Best regards
Thomas
|
|
|
Powered by
FUDForum. Page generated in 0.01791 seconds