wood burning stoves 2.0*
The moose likes Object Relational Mapping and the fly likes Audit Logging in Ibatis. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Audit Logging in Ibatis." Watch "Audit Logging in Ibatis." New topic
Author

Audit Logging in Ibatis.

Deepak Lal
Ranch Hand

Joined: Jul 01, 2008
Posts: 507

Hi,
How do we perform audit logging in Ibatis ?Please post the code in case you have any for Audit logging in Ibatis Framework.I dont want to write a Trigger becaause it is a costly operation and it will be tighly coupled to specific vendor/Database.Any generic soltuion/Code please share.

Example:See below
So i have 2 tables primarily

Primary table:Here Insert/Update/Delete is happening
Audit logging table: Column names are --> Entity/Table Name Inserted/Updated/Deleted|Updated By|Updated On

Please add more of your suggestions./advice you will give me for this approach.

Please reply.....

Thanks and Regards
Deepak Lal


When The Going Gets Tougher,The Tougher gets Going
Deepak Lal
Ranch Hand

Joined: Jul 01, 2008
Posts: 507

Hi,
I need help on this post.
Thanks and Regards
Deepak lal
Deepak Lal
Ranch Hand

Joined: Jul 01, 2008
Posts: 507

Hi,
I need help on this post. Please help me Ranchers
Thanks and Regards
Deepak lal
Deepak Lal
Ranch Hand

Joined: Jul 01, 2008
Posts: 507

Please need help,Anyone who can help me out.
amit punekar
Ranch Hand

Joined: May 14, 2004
Posts: 511
Hello,
If you want to do the audit log then you can either write the SQL or execute the Stored procedure that would update the audit table.
Call to this can be embedded before you call your SQLs or Stored procedures in your application.
In a better way of implementing it you can re-factor the code to invoke the SQL or SP in a helper class. This would help you to embed the audit call at one place.
I am not very certain if you have any readily available tool in iBatis that would do the audit logging for you.
I would suggest using the Trigger which would anyway reduce one database call from Data access layer.

hope this helps,
Amit
Deepak Lal
Ranch Hand

Joined: Jul 01, 2008
Posts: 507

Hi Amit and Ranchers,
I want to accomplish this WITHOUt USING a Trigger (or) a Stored procedure,Any other way ?
Best Regards
Deepak lal
Deepak Lal
Ranch Hand

Joined: Jul 01, 2008
Posts: 507

Help please
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Audit Logging in Ibatis.
 
Similar Threads
wrong redirection from j_security_check when user in different role
Audit Trail for Web Application
Auditing and Logging in EJB CMPs
Auditing Table
Transaction in trigger