Re: Audit log with OpenJPA

2011-08-05 Thread Bengt Rodehav
Project -- View this message in context: http://openjpa.208410.n2.nabble.com/Audit-log-with-OpenJPA-tp6557932p6645998.html Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: Audit log with OpenJPA

2011-08-02 Thread Pinaki Poddar
/Audit-log-with-OpenJPA-tp6557932p6645998.html Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: Audit log with OpenJPA

2011-07-29 Thread pif
perhaps http://jpasecurity.sourceforge.net/ can help you to control access as JPA xxtension, but it's more for security auditing than just logging regards Frank -- View this message in context: http://openjpa.208410.n2.nabble.com/Audit-log-with-OpenJPA-tp6557932p6632956.html Sent from

Re: Audit log with OpenJPA

2011-07-29 Thread Bengt Rodehav
this message in context: http://openjpa.208410.n2.nabble.com/Audit-log-with-OpenJPA-tp6557932p6632956.html Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: Audit log with OpenJPA

2011-07-27 Thread Mark Struberg
into the StateManager stuff a big time and am ready to help out once we know how we'd like to solve this. LieGrue, strub --- On Tue, 7/26/11, Bengt Rodehav be...@rodehav.com wrote: From: Bengt Rodehav be...@rodehav.com Subject: Re: Audit log with OpenJPA To: users@openjpa.apache.org Date: Tuesday

Re: Audit log with OpenJPA

2011-07-27 Thread Bengt Rodehav
in context: http://openjpa.208410.n2.nabble.com/Audit-log-with-OpenJPA-tp6557932p6624609.html Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: Audit log with OpenJPA

2011-07-26 Thread Pinaki Poddar
this message in context: http://openjpa.208410.n2.nabble.com/Audit-log-with-OpenJPA-tp6557932p6623086.html Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: Audit log with OpenJPA

2011-07-26 Thread Bengt Rodehav
a JUnit test and post it to OPENJPA-2030 [1] [1] https://issues.apache.org/jira/browse/OPENJPA-2030 - Pinaki Poddar Chair, Apache OpenJPA Project -- View this message in context: http://openjpa.208410.n2.nabble.com/Audit-log-with-OpenJPA-tp6557932p6623086.html Sent from the OpenJPA

Re: Audit log with OpenJPA

2011-07-26 Thread Pinaki Poddar
, then I will commit the changes. - Pinaki Poddar Chair, Apache OpenJPA Project -- View this message in context: http://openjpa.208410.n2.nabble.com/Audit-log-with-OpenJPA-tp6557932p6624609.html Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: Audit log with OpenJPA

2011-07-25 Thread Bengt Rodehav
with the options Mark has suggested. I will recommend you make sure the following 1. Enhance at build time 2. Set openjpa.RestoreState=true - Pinaki Poddar Chair, Apache OpenJPA Project -- View this message in context: http://openjpa.208410.n2.nabble.com/Audit-log

Re: Audit log with OpenJPA

2011-07-21 Thread Bengt Rodehav
experiment with the options Mark has suggested. I will recommend you make sure the following 1. Enhance at build time 2. Set openjpa.RestoreState=true - Pinaki Poddar Chair, Apache OpenJPA Project -- View this message in context: http://openjpa.208410.n2.nabble.com/Audit-log

Re: Audit log with OpenJPA

2011-07-19 Thread Bengt Rodehav
committed (got my time eaten up by a few other Apache projects lately). LieGrue, stru --- On Sat, 7/16/11, Bengt Rodehav be...@rodehav.com wrote: From: Bengt Rodehav be...@rodehav.com Subject: Re: Audit log with OpenJPA To: users@openjpa.apache.org Date: Saturday, July 16, 2011, 8:40 PM

Re: Audit log with OpenJPA

2011-07-19 Thread Pinaki Poddar
openjpa.RestoreState=true - Pinaki Poddar Chair, Apache OpenJPA Project -- View this message in context: http://openjpa.208410.n2.nabble.com/Audit-log-with-OpenJPA-tp6557932p6599036.html Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: Audit log with OpenJPA

2011-07-19 Thread Mark Struberg
working in a cluster or load balancer scenario. LieGrue, strub --- On Tue, 7/19/11, Pinaki Poddar ppod...@apache.org wrote: From: Pinaki Poddar ppod...@apache.org Subject: Re: Audit log with OpenJPA To: users@openjpa.apache.org Date: Tuesday, July 19, 2011, 2:47 PM Hi Bengt

Re: Audit log with OpenJPA

2011-07-19 Thread Mark Struberg
working in a cluster or load balancer scenario. LieGrue, strub --- On Tue, 7/19/11, Pinaki Poddar ppod...@apache.org wrote: From: Pinaki Poddar ppod...@apache.org Subject: Re: Audit log with OpenJPA To: users@openjpa.apache.org Date: Tuesday, July 19, 2011, 2:47 PM Hi Bengt

Re: Audit log with OpenJPA

2011-07-18 Thread Pinaki Poddar
Poddar Chair, Apache OpenJPA Project -- View this message in context: http://openjpa.208410.n2.nabble.com/Audit-log-with-OpenJPA-tp6557932p6594830.html Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: Audit log with OpenJPA

2011-07-16 Thread Bengt Rodehav
to know all about its state. Please see the blog post -- it has some toy code. - Pinaki Poddar Chair, Apache OpenJPA Project -- View this message in context: http://openjpa.208410.n2.nabble.com/Audit-log-with-OpenJPA-tp6557932p6585154.html Sent from the OpenJPA Users mailing list

Re: Audit log with OpenJPA

2011-07-16 Thread Mark Struberg
, Apache OpenJPA Project -- View this message in context: http://openjpa.208410.n2.nabble.com/Audit-log-with-OpenJPA-tp6557932p6585154.html Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: Audit log with OpenJPA

2011-07-15 Thread Bengt Rodehav
.nabble.com/Audit-log-with-OpenJPA-tp6557932p6585154.html Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: Audit log with OpenJPA

2011-07-14 Thread Bengt Rodehav
Hi again Jim, 2011/7/14 Jim Talbut jtal...@spudsoft.co.uk On 13/07/2011 21:14, Pinaki Poddar wrote: Yes. Any audit facility needs to have a snapshot of the entity when it entered a persistence context, so at @PreUpdate or at any other time points, it can figure out what has essentially

Re: Audit log with OpenJPA

2011-07-14 Thread Pinaki Poddar
.208410.n2.nabble.com/Audit-log-with-OpenJPA-tp6557932p6583813.html Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: Audit log with OpenJPA

2011-07-14 Thread Bengt Rodehav
-log-with-OpenJPA-tp6557932p6583813.html Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: Audit log with OpenJPA

2011-07-14 Thread Bengt Rodehav
, Apache OpenJPA Project -- View this message in context: http://openjpa.208410.n2.nabble.com/Audit-log-with-OpenJPA-tp6557932p6583813.html Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: Audit log with OpenJPA

2011-07-13 Thread Pinaki Poddar
= OpenJPAPersistence.getEntityManager(this); // And persist the audit information in the same transaction em.persist(audit); } - Pinaki Poddar Chair, Apache OpenJPA Project -- View this message in context: http://openjpa.208410.n2.nabble.com/Audit-log-with-OpenJPA-tp6557932p6580549.html Sent from

Re: Audit log with OpenJPA

2011-07-13 Thread Bengt Rodehav
.nabble.com/Audit-log-with-OpenJPA-tp6557932p6580549.html Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: Audit log with OpenJPA

2011-07-13 Thread Bengt Rodehav
this message in context: http://openjpa.208410.n2.nabble.com/Audit-log-with-OpenJPA-tp6557932p6580549.html Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: Audit log with OpenJPA

2011-07-13 Thread Jim Talbut
On 13/07/2011 21:14, Pinaki Poddar wrote: Yes. Any audit facility needs to have a snapshot of the entity when it entered a persistence context, so at @PreUpdate or at any other time points, it can figure out what has essentially been changed about that entity in a transaction. Now either one can

Re: Audit log with OpenJPA

2011-07-12 Thread Jim Talbut
On 07/07/2011 12:05, Bengt Rodehav wrote: I'm using OpenJPA for persistence and would like to audit log any changes made to my entities. I serialize the objects to JSON (with Gson) and store them in a separate table in the database. Since the audit log needs to have the correct id's, the audit

Re: Audit log with OpenJPA

2011-07-12 Thread Bengt Rodehav
Thanks for your post Jim, In the past (when we rolled our own O/R mapping) we also generated the id's ourselves via sequences stored in a dedicated table. Come to think of it, one of the reasons was exactly what you are talking about - one can reference the id even before the object is persisted.

Re: Audit log with OpenJPA

2011-07-12 Thread Bengt Rodehav
Jim, Why do you think that your approach is not supported by JPA? From other posts on this list I've seen that you are allowed to add/enrich your entity in the PreUpdate/PreCreate callbacks. That's all you are doing right. Then JPA persists your enriched entities. What do you violate? /Bengt

Re: Audit log with OpenJPA

2011-07-12 Thread Jim Talbut
On 12/07/2011 09:33, Bengt Rodehav wrote: Why do you think that your approach is not supported by JPA? From other posts on this list I've seen that you are allowed to add/enrich your entity in the PreUpdate/PreCreate callbacks. That's all you are doing right. Then JPA persists your enriched

Re: Audit log with OpenJPA

2011-07-12 Thread Bengt Rodehav
Jim, I tried your approach (I think) but got the following exception: *openjpa-2.0.1-r422266:989424 nonfatal user error org.apache.openjpa.persistence.InvalidStateException: Encountered unmanaged object in persistent field se.digia.maia.common.persistence.EntityBase.auditLogelement:class

Re: Audit log with OpenJPA

2011-07-08 Thread Bengt Rodehav
] http://www.ibm.com/developerworks/java/library/j-jest/?ca=drs- [2] http://openjpa.apache.org/jest [3] https://www.ibm.com/developerworks/mydeveloperworks/blogs/pinaki/tags/jest?lang=en - Pinaki -- View this message in context: http://openjpa.208410.n2.nabble.com/Audit-log-with-OpenJPA

Re: Audit log with OpenJPA

2011-07-08 Thread Bengt Rodehav
to the persistence context is right there in the entity. - Pinaki -- View this message in context: http://openjpa.208410.n2.nabble.com/Audit-log-with-OpenJPA-tp6557932p6560548.html Sent from the OpenJPA Users mailing list archive at Nabble.com.

Audit log with OpenJPA

2011-07-07 Thread Bengt Rodehav
I'm using OpenJPA for persistence and would like to audit log any changes made to my entities. I serialize the objects to JSON (with Gson) and store them in a separate table in the database. Since the audit log needs to have the correct id's, the audit logging must take place after the entity has

Re: Audit log with OpenJPA

2011-07-07 Thread Jari Fredriksson
7.7.2011 14:05, Bengt Rodehav kirjoitti: I'm using OpenJPA for persistence and would like to audit log any changes made to my entities. I serialize the objects to JSON (with Gson) and store them in a separate table in the database. Since the audit log needs to have the correct id's, the audit

Re: Audit log with OpenJPA

2011-07-07 Thread David Goodenough
On Thursday 07 Jul 2011, Bengt Rodehav wrote: I'm using OpenJPA for persistence and would like to audit log any changes made to my entities. I serialize the objects to JSON (with Gson) and store them in a separate table in the database. Since the audit log needs to have the correct id's, the

AW: Audit log with OpenJPA

2011-07-07 Thread Boblitz John
-Ursprüngliche Nachricht- Von: David Goodenough [mailto:david.goodeno...@btconnect.com] Gesendet: Donnerstag, 7. Juli 2011 16:36 An: users@openjpa.apache.org Betreff: Re: Audit log with OpenJPA On Thursday 07 Jul 2011, Bengt Rodehav wrote: I'm using OpenJPA for persistence

Re: Audit log with OpenJPA

2011-07-07 Thread Andrew Thompson
You might take a look at how hades (http://hades.synyx.org/static/2.x/site/org.synyx.hades/reference/html/auditing.html) does something close to what you're describing. Or http://www.jboss.org/envers -Andy On Thu, 2011-07-07 at 15:35 +0100, David Goodenough wrote: On Thursday 07 Jul 2011,

Re: Audit log with OpenJPA

2011-07-07 Thread Bengt Rodehav
Jari, Yes an asynchronous queue is definitely an option. I've actually used that approach before. It makes a lot of sense when trying to achieve high throughput since the audit logging can then be done on lower priority. I was however hoping to be able to use JPA for this since a queue increases

Re: Audit log with OpenJPA

2011-07-07 Thread Bengt Rodehav
Thanks for your reply David, I wouldn't rule out cheating although I'd rather not. I have no experience in mixing JDBC and JPA. What would happen transaction wise? Can they both be part of the same transaction? /Bengt 2011/7/7 David Goodenough david.goodeno...@btconnect.com On Thursday 07 Jul

Re: Audit log with OpenJPA

2011-07-07 Thread Rick Curtis
Perhaps you could use a separate PU for your audit logging? That should be safe to use inside of a lifecycle callback. On Thu, Jul 7, 2011 at 11:36 AM, Bengt Rodehav be...@rodehav.com wrote: Jari, Yes an asynchronous queue is definitely an option. I've actually used that approach before. It

Re: Audit log with OpenJPA

2011-07-07 Thread Bengt Rodehav
I actually use the same approach as Hades for createdBy, updatedBy, createdWhen and updatedWhen. In addition to this basic audit logging I also want to log all historical versions together with information about who updated the object. I've read a little bit about Envers. I didn't want to bring

Re: Audit log with OpenJPA

2011-07-07 Thread Bengt Rodehav
Interesting suggestion. Can I still share the same transaction between the original update and my audit log insert? /Bengt 2011/7/7 Rick Curtis curti...@gmail.com Perhaps you could use a separate PU for your audit logging? That should be safe to use inside of a lifecycle callback. On Thu,

Re: Audit log with OpenJPA

2011-07-07 Thread Jari Fredriksson
How is your JPA accessed? I have done JPA, and Audit logging on top of it, but it was into XML files, and performed in a EJB3 Session Bean. The JPA objects were plain simple, but they were all accessed via a Session Bean Facade. I did it with XML because boss wanted so, but could have been

Re: Audit log with OpenJPA

2011-07-07 Thread No1UNo
, but if this audit trail is write only for this app and only read elsewhere that would solve the problem. David If you reply to this email, your message will be added to the discussion below: http://openjpa.208410.n2.nabble.com/Audit-log-with-OpenJPA-tp6557932p6559076.html

Re: Audit log with OpenJPA

2011-07-07 Thread Pinaki Poddar
-- but at the level at which OpenJPA API is being accessed here, much more facilities are available to compute the 'delta'. [1] http://webspherepersistence.blogspot.com/2009/01/auditing-with-openjpa.html - Pinaki -- View this message in context: http://openjpa.208410.n2.nabble.com/Audit-log

Re: Audit log with OpenJPA

2011-07-07 Thread Mark Struberg
submitted since we didn't quite agree if it is spec conform. LieGrue, strub --- On Thu, 7/7/11, Pinaki Poddar ppod...@apache.org wrote: From: Pinaki Poddar ppod...@apache.org Subject: Re: Audit log with OpenJPA To: users@openjpa.apache.org Date: Thursday, July 7, 2011, 7:58 PM Hi,   Good

Re: Audit log with OpenJPA

2011-07-07 Thread Bengt Rodehav
Jarl, In production I run my application in OSGi (Apache Karaf). I use Apache Aries JPA support to publish entity manager factories and to enlist into JTA transactions. I've abandoned JEE since a while now - am even moving away from Spring I've also used XML before but I've recently moved

Re: Audit log with OpenJPA

2011-07-07 Thread Bengt Rodehav
://openjpa.208410.n2.nabble.com/Audit-log-with-OpenJPA-tp6557932p6559076.html To start a new topic under OpenJPA Users, email ml-node+208411-1703014788-244...@n2.nabble.com To unsubscribe from OpenJPA Users, click here. -- View this message in context: http://openjpa.208410.n2.nabble.com/Audit

Re: Audit log with OpenJPA

2011-07-07 Thread Bengt Rodehav
-- but at the level at which OpenJPA API is being accessed here, much more facilities are available to compute the 'delta'. [1] http://webspherepersistence.blogspot.com/2009/01/auditing-with-openjpa.html - Pinaki -- View this message in context: http://openjpa.208410.n2.nabble.com/Audit-log

Re: Audit log with OpenJPA

2011-07-07 Thread Bengt Rodehav
: From: Pinaki Poddar ppod...@apache.org Subject: Re: Audit log with OpenJPA To: users@openjpa.apache.org Date: Thursday, July 7, 2011, 7:58 PM Hi, Good to see lot of new ideas about auditing. Here is one more [1] that uses OpenJPA specific internals of accessing the original

Re: Audit log with OpenJPA

2011-07-07 Thread Pinaki Poddar
for a OpenJPA-specific cast, then the handle to the persistence context is right there in the entity. - Pinaki -- View this message in context: http://openjpa.208410.n2.nabble.com/Audit-log-with-OpenJPA-tp6557932p6560548.html Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: Audit log with OpenJPA

2011-07-07 Thread Pinaki Poddar
://www.ibm.com/developerworks/java/library/j-jest/?ca=drs- [2] http://openjpa.apache.org/jest [3] https://www.ibm.com/developerworks/mydeveloperworks/blogs/pinaki/tags/jest?lang=en - Pinaki -- View this message in context: http://openjpa.208410.n2.nabble.com/Audit-log-with-OpenJPA