audit

How to get Java reflect to spot fields in the super class? not just the actual class [duplicate]

試著忘記壹切 提交于 2019-12-01 14:59:39
This question already has an answer here: Retrieving the inherited attribute names/values using Java Reflection 12 answers I've recently changed my schema a bit so my classes inherit from a super class, problem is my comparison method which generates an audit log, using Java reflect, is now only looping through the fields of the child class, not the superclass, is there a way to get all the FIELDS? or do I need to cast it into the super class.....? Heres my method below: public static <T> String GenerateChangeLogForEntity(T old, T updated) { String text = ""; try { Field[] fields = old

Identify the action that is deleting all rows in a table

为君一笑 提交于 2019-12-01 14:31:43
There is SQL Server 2012 database that is used by three different applications. In that database there is a table that contains ~500k rows and for some mysterious reason this table gets emptied every now and then. I think this is possibly caused by: A delete query without a where clause A delete query in a loop gone wild I am trying to locate the cause of this issue by reviewing code but no joy. I need an alternate strategy. I think I can use triggers to detect what/why all rows get deleted but I am not sure how to go about this. So: Can I use triggers to check if a query is attempting to

SQL Server auto audit updated column

∥☆過路亽.° 提交于 2019-12-01 01:21:41
I need to create a trigger on SQL Server to write only updated column into an audit table with table name, column name, previous/new value, date, time and user for specific tables. How can I do this? StackTrace i normally have a table like this to store the audit data and i got this solution from here https://www.simple-talk.com/sql/database-administration/pop-rivetts-sql-server-faq-no.5-pop-on-the-audit-trail/ CREATE TABLE [dbo].[Audit]( [AuditID] [int] IDENTITY(1,1) NOT NULL, [Type] [char](1) NULL, [TableName] [varchar](128) NULL, [PK] [varchar](1000) NULL, [FieldName] [varchar](128) NULL,

Audit logging nhibernate

瘦欲@ 提交于 2019-12-01 01:14:54
could you provide some samples for audit loggin using NHibernate (ASP.Net+C# codd, not java code) Event Listeners are better for audit info than Interceptors. Here's a great example from Ayende's blog . I've most often seen this done with interceptors. There are plenty of blog postings to be found through Google about implementing interceptors for auditing, like this one . 来源: https://stackoverflow.com/questions/857234/audit-logging-nhibernate

SQL Server auto audit updated column

随声附和 提交于 2019-11-30 20:24:06
问题 I need to create a trigger on SQL Server to write only updated column into an audit table with table name, column name, previous/new value, date, time and user for specific tables. How can I do this? 回答1: i normally have a table like this to store the audit data and i got this solution from here https://www.simple-talk.com/sql/database-administration/pop-rivetts-sql-server-faq-no.5-pop-on-the-audit-trail/ CREATE TABLE [dbo].[Audit]( [AuditID] [int] IDENTITY(1,1) NOT NULL, [Type] [char](1)

Audit logging nhibernate

浪尽此生 提交于 2019-11-30 20:14:39
问题 could you provide some samples for audit loggin using NHibernate (ASP.Net+C# codd, not java code) 回答1: Event Listeners are better for audit info than Interceptors. Here's a great example from Ayende's blog. 回答2: I've most often seen this done with interceptors. There are plenty of blog postings to be found through Google about implementing interceptors for auditing, like this one. 来源: https://stackoverflow.com/questions/857234/audit-logging-nhibernate

How to find out who ran the TFS Destroy Command?

半腔热情 提交于 2019-11-30 13:22:34
问题 I have reason to believe that the TFS Destroy command was run on my server. Does TFS provide a way to find out who and when it was done? 回答1: TFS logs all user-initiated commands in the database for 14 days. Try connect to your Tfs_Collection database and run the following query: SELECT * FROM tbl_Command WITH (NOLOCK) WHERE Command = 'Destroy' Additionally, any time a Destroy command is run, an event is logged to the Application Event Log on the Application Tier that processed the command.

Is this the best approach to creating an audit trail?

会有一股神秘感。 提交于 2019-11-30 10:50:50
I'm trying to create some functionality that keeps an audit trail of how data in a given user form has been changed over time, with a dated audit at the foot of that page. For example: 02/04/09 21:49 Name changed from "Tom" to "Chris". I'm doing this by storing the data in it's present format in the session and then on save checking whether there are any differences in the data being stored. If there are, I'm storing the data how it was before the latest edit in a table called history, and storing the new values in the current user table. Is this the best approach to be taking? One suggestion;

NHibernate Interceptor Auditing Inserted Object Id

谁说胖子不能爱 提交于 2019-11-30 10:09:27
I am using NHibernate interceptors to log information about Updates/Inserts/Deletes to my various entities. Included in the information logged is the Entity Type and the Unique Id of the entity modified. The unique Id is marked as a <generator class="identity"> in the NHibernate mapping file. The obvious problem is when logging an Insert operation using IInterceptor.OnSave() the Id of the entity has not yet been assigned. How can I obtain the Id of the inserted entity before logging the audit information? (I have looked into NHibernate Listeners PostSave event but can't get them working with

How to find out who ran the TFS Destroy Command?

早过忘川 提交于 2019-11-30 07:28:29
I have reason to believe that the TFS Destroy command was run on my server. Does TFS provide a way to find out who and when it was done? TFS logs all user-initiated commands in the database for 14 days. Try connect to your Tfs_Collection database and run the following query: SELECT * FROM tbl_Command WITH (NOLOCK) WHERE Command = 'Destroy' Additionally, any time a Destroy command is run, an event is logged to the Application Event Log on the Application Tier that processed the command. I guess this is related to your earlier question. I don't think TFS provides an easy way (or any way) to do