-
1. Re: On/Off envers for selected entities in runtime
talios Jan 4, 2009 4:35 PM (in response to chand0s)I guess the -easiest- way for you to control this would be to wrap the envers listeners with your own, and add your own enable/disable functionality.
-
2. Re: On/Off envers for selected entities in runtime
adamw Jan 6, 2009 2:21 AM (in response to chand0s)Hello,
there is no out-of-the box way to do it, and talios's advice is very good - that's the way you should do it.
Also, if you wish, you could always propose a patch to fix this; it would be very welcome - I think other users have been requesting it as well.
Adam -
3. Re: On/Off envers for selected entities in runtime
chand0s Jan 8, 2009 10:10 AM (in response to chand0s)2talios
Thank you, it is really a very easy solution. It took about 15 minutes
2adamw
I think that I need much more knowledge about envers internals and "envers way" :)
I've looked at sources, but I still have some questions, for example - how configuration class must look like etc.
However I can create feature request in JIRA :) -
5. Re: On/Off envers for selected entities in runtime
adamw Jan 8, 2009 4:25 PM (in response to chand0s)Ok, thanks :)
If you would like to dive into Envers and contribute, and have some questions about the code, feel free to ask :)
--
Adam -
6. Re: On/Off envers for selected entities in runtime
sfuser Apr 29, 2009 4:04 PM (in response to chand0s)Hi chand0s, can you post your code that overridden newRevision to disable the hibernate audit?
Thank you
--------------
package com.successfactors.xi.persistence.hibernate;
import org.jboss.envers.RevisionListener;
import org.jboss.seam.Component;
public class ExampleListener implements RevisionListener {
public void newRevision(Object revisionEntity) {
RevEntity revEntity = (RevEntity) revisionEntity;
// do not audit this entity .....
// .......
}
} -
7. Re: On/Off envers for selected entities in runtime
sfuser Apr 30, 2009 6:48 PM (in response to chand0s)Hi,
Let me elaborate more on the code needed. I'm looking at executeInSession() but it doesn't have any conditions to turn off auditing per entity. Or I can't seem to see it :) if it does.