[Opensource] Réf. : Re: [Opensource] Bug when using AuditedSecuredDBObject
Raul DAVIDOVICH
R.DAVIDOVICH at caconcology.com
Fri Jan 16 01:59:19 PST 2004
I found it in the source code and then I found some references to it in the
forusm... I just can't remember exactly where :-(
It logs the user, the date, the operation and the destination table.
As for my needs, it's ok for add and delete, but for updates it lacks the
destination field and at least the old value. but in large transactional
environments this can add some overhead. If you find this interesting, one
idea could be to have two AuditedSecuredDBObjects: a basic one and an
extended one...
What I did os to build my own AuditTrail extending AuditedSecuredDBObject
which logs the field updates with old and new values, and make all my
dbobjects to extend this one, since I have expresso and my data in separate
db's this gives me an extra security layer.
this is the audit trail code I wrote:
private synchronized void writeAuditTrail() throws DBException {
AuditTrailDBObject at = new AuditTrailDBObject();
at.setDataContext(this.getDataContext());
at.setRequestingUid(this.getRequestingUid());
FieldUpdate updatedField = null;
ListIterator updatesIterator = myUpdates.listIterator();
while(updatesIterator.hasNext()){
updatedField = (FieldUpdate) updatesIterator.next();
at.clear();
at.setField("table", this.getJDBCMetaData().getTargetTable());
at.setField("line", this.getField("id"));
at.setField("field", updatedField.fieldName);
at.setField("old", updatedField.oldValue);
at.setField("new", updatedField.newValue);
at.setField("authorr", this.getRequestingUid());
at.setField("date", new Date());
at.add();
}
I'll be happy to get your comments on this
Regards,
---------------------------------------------------
Raul Davidovich
Responsable Informatique
Cvitkovic & Associés Consultants
(33) 1 45 15 40 68
(33) 1 45 15 40 41 Fax
-------------------------------------------------------
http://www.caconcology.com
|---------+------------------------------->
| | Mike Traum |
| | <mtraum at jgroup.net> |
| | Envoyé par : |
| | opensource-admin at jco|
| | rporate.com |
| | |
| | |
| | 15/01/2004 19:32 |
| | Veuillez répondre à |
| | opensource |
| | |
|---------+------------------------------->
>--------------------------------------------------------------------------------------------------------------------------------------------------|
| |
| Pour : opensource at jcorporate.com |
| cc : |
| Objet : Re: [Opensource] Bug when using AuditedSecuredDBObject |
>--------------------------------------------------------------------------------------------------------------------------------------------------|
Thanks for the report - I will look into it asap.
BTW, I've never used this class - did you find reference to it in
documentation, or just the code and javadocs? Do you find that it meets
your needs?
Thanks,
mike
On Thu, 2004-01-15 at 04:26, Raul DAVIDOVICH wrote:
> Hello,
>
>
> I found that two DBObjects that are required for using the adutit trail
> provided by AuditedSecuredDBObject are missing in
> ExpressoSchema.constructDBObjects().
>
> these are com.jcorporate.expresso.ext.dbobj.AuditLog and
> com.jcorporate.expresso.ext.dbobj.AuditLogL
>
> for this to work one must add the addDBObject() lines to
constructDBObjects
> (), re-run expresso setup to create the tables, and then populate the
> AUDITLOG_L table with three values: "ADD", "DEL", and "UPT".
>
>
>
> Regards,
>
> ---------------------------------------------------
> Raul Davidovich
> Responsable Informatique
> Cvitkovic & Associés Consultants
>
> (33) 1 45 15 40 68
> (33) 1 45 15 40 41 Fax
> -------------------------------------------------------
> http://www.caconcology.com
>
>
> _______________________________________________
> Opensource mailing list
> Opensource at jcorporate.com
> http://mail.jcorporate.com/mailman/listinfo/opensource
> Archives: http://mail.jcorporate.com/pipermail/opensource/
--
Mike Traum
--
JGroup Expert
Expresso Core Developer
Providing support and development services - Available Now!
_______________________________________________
Opensource mailing list
Opensource at jcorporate.com
http://mail.jcorporate.com/mailman/listinfo/opensource
Archives: http://mail.jcorporate.com/pipermail/opensource/
More information about the Opensource
mailing list