Re: Database recommendation: Maria DB or PostgreSQL

2016-12-12 Thread Bengt Rodehav
Sorry, never did thank you for your reply! I ended up choosing PostgreSQL and so far it works fine. /Bengt 2016-10-07 11:37 GMT+02:00 Francesco Chicchiriccò <ilgro...@apache.org>: > On 07/10/2016 10:47, Francesco Chicchiriccò wrote: > >> On 07/10/2016 09:47, Bengt Rodehav

Database recommendation: Maria DB or PostgreSQL

2016-10-07 Thread Bengt Rodehav
I'm in the process of choosing database system for my next project. It's a web application running on Apache Karaf. Not very high throughput requirements. Easy operation (backup/restore and good GUI) is important to me. But, I also need to know that it works well with OpenJPA. In the OpenJPA

Re: OpenJPA and auto-commit

2016-07-12 Thread Bengt Rodehav
The other point could be a start order behavior, but I also saw that > pax-jdbc karaf feature is now using karaf requirement and capabilities so > it could be also fixed ;). > > So let's wait and see K4.0.6 version! > > Regards, > > 2016-07-11 10:23 GMT+02:00 Bengt Rodehav <

Re: SQL Server 2014

2015-09-20 Thread Bengt Rodehav
3:34 em skrev "Bengt Rodehav" <be...@rodehav.com>: > We have just updated our SQL Server from 2008 to 2014. We are using > OpenJPA 2.1.1. We used to use version 3.0 of Microsoft's JDBC driver. > However, it didn't work with 2014. Somewhere I read that I need at least >

Re: OpenJPA Audit

2012-06-28 Thread Bengt Rodehav
Sounds like an interesting idea to me. It would allow me to import any packages I need in order to properly configure the entity manager factory. My original idea was that OpenJPA should use the class loader for the bundle that contained the persistence.xml. That way I could make sure that bundle

Re: OpenJPA Audit

2012-06-27 Thread Bengt Rodehav
Hello Pinaki, Do you know if there is any progress on the class loading refactoring you initiated a while back? /Bengt 2012/6/27 Pinaki Poddar ppod...@apache.org Hi, Wow. Good to know that you have found this audit facility useful. I have added a test that shows an example of

Re: OpenJPA Audit

2012-06-23 Thread Bengt Rodehav
Hello there Jim, I was part of initiating that support for OpenJPA (Pinaki implemented it) but I haven't used it myself yet. The reason is that I couldn't get the class loading to work when running within OSGi. There is still an outstanding issue regarding this:

Re: Problems with SQLServer VARCHAR(MAX)

2012-04-02 Thread Bengt Rodehav
Has no one else encountered this? Does someone has any ideas of how to get rid of this? /Bengt 2012/3/29 Bengt Rodehav be...@rodehav.com I'm using OpenJPA 2.1.1 with Microsoft SQLServer 2005. In one of my entities I have a field that can potentially be quite large (it represents an incoming

Re: Problems with SQLServer VARCHAR(MAX)

2012-04-02 Thread Bengt Rodehav
: bengt.rode...@gmail.com [mailto:bengt.rode...@gmail.com] Im Auftrag von Bengt Rodehav Gesendet: Montag, 2. April 2012 08:59 An: users@openjpa.apache.org Betreff: Re: Problems with SQLServer VARCHAR(MAX) Has no one else encountered this? Does someone has any ideas of how to get rid

Problems with SQLServer VARCHAR(MAX)

2012-03-29 Thread Bengt Rodehav
I'm using OpenJPA 2.1.1 with Microsoft SQLServer 2005. In one of my entities I have a field that can potentially be quite large (it represents an incoming XML message). I therefore store it in a column defined as VARCHAR(MAX). This possibility was introduced in SQLServer 2005 and allows storing

Re: Slow query with SQL Server

2011-12-22 Thread Bengt Rodehav
with OpenJPA (and perhaps Karaf). I will also cross post this on the Aries list. I appreciate any help, /Bengt 2011/12/21 Bengt Rodehav be...@rodehav.com I'm using OpenJPA 2.1.1 on Karaf 2.2.4. I also use the aries transaction support (0.3). I use SQL Server 2005. I'm getting very slow query

Re: Slow query with SQL Server

2011-12-22 Thread Bengt Rodehav
of INFO which explains the big difference in performance. /Bengt 2011/12/22 Bengt Rodehav be...@rodehav.com Here is an update reflecting my latest findings. It seems I only get bad performance when running inside Karaf. E g retrieving all rows in the table (5800) takes about 130 ms when I run

Slow query with SQL Server

2011-12-21 Thread Bengt Rodehav
I'm using OpenJPA 2.1.1 on Karaf 2.2.4. I also use the aries transaction support (0.3). I use SQL Server 2005. I'm getting very slow query responses. Retrieving 330 rows with 5 columns takes almost 4 seconds (about 100 bytes per row). Running the SQL Server profiler I can see that the actual

Re: How to configure transaction timeout?

2011-12-21 Thread Bengt Rodehav
Thanks for your advice Pinaki - will try it. I guess though that these timeouts will not affect aries-jta's transaction timeout but they will still cause the transaction to fail - right? Yes, I read on this list that the classloading refactoring wasn't successful. Looking forward to a new

How to configure transaction timeout?

2011-12-13 Thread Bengt Rodehav
I use Aries JPA and Aries Transaction with OpenJpa. I have problems with some long transactions that time out (I think anyway). I cannot see where I can configure the transaction timeout for Aries Transaction. The only interaction I have with Aries Transaction is my blueprint definition where I

Re: Problems getting the old state of a Map / auditing

2011-09-29 Thread Bengt Rodehav
Yes that is correct. I think the functionality is very useful and I did get it to work when running outside of OSGi. However, in OSGi there seems to be a class loading issue that prevents OpenJPA from finding my auditor class. For me, OSGi is a requirement but for those who do not require OSGi,

Re: Auditor and OSGi

2011-09-16 Thread Bengt Rodehav
I created the following JIRA: https://issues.apache.org/jira/browse/OPENJPA-2052 /Bengt 2011/9/13 Bengt Rodehav be...@rodehav.com Hello, Just wanted to check if you've had any chance to look at this Pinak. /Bengt 2011/9/8 Bengt Rodehav be...@rodehav.com Hello again, I'm

Re: Auditor and OSGi

2011-09-13 Thread Bengt Rodehav
Hello, Just wanted to check if you've had any chance to look at this Pinak. /Bengt 2011/9/8 Bengt Rodehav be...@rodehav.com Hello again, I'm not familiar with the class resolver plugin but I did the following: - I created a resolver (code is at the end of the mail) - I configured my

Re: Auditor and OSGi

2011-09-08 Thread Bengt Rodehav
Hello again, I'm not familiar with the class resolver plugin but I did the following: - I created a resolver (code is at the end of the mail) - I configured my persistence.xml to use that resolver (persistence.xml at the end of the mail) The above does not throw any exceptions on startup. On

Re: Auditor and OSGi

2011-09-06 Thread Bengt Rodehav
confirm this? Shalll I create a JIRA? /Bengt 2011/9/4 Bengt Rodehav be...@rodehav.com Hello everyone, After a long discussion about audit logging on this mailing list, Pinaki developed an audit logging facility that he describes on: http://openjpa.208410.n2.nabble.com/OpenJPA-Audit-Facility

Auditor and OSGi

2011-09-04 Thread Bengt Rodehav
Hello everyone, After a long discussion about audit logging on this mailing list, Pinaki developed an audit logging facility that he describes on: http://openjpa.208410.n2.nabble.com/OpenJPA-Audit-Facility-tc6722915.html It provides very interesting functionality and I've tried it in simple

Re: Audit log with OpenJPA

2011-08-05 Thread Bengt Rodehav
Pinaki, I've been on vacation again for a week which is why I'm late replying. I think there must be a way to get hold of the original object since that's the object I need to audit log. An unmanaged POJO is fine for my purposes since I just want to serialize it. I will then persist it to a

Re: Audit log with OpenJPA

2011-07-29 Thread Bengt Rodehav
Interesting - will definitely take a look. /Bengt Den 29 jul 2011 19:24 skrev pif frank.pien...@googlemail.com: 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

Re: Audit log with OpenJPA

2011-07-27 Thread Bengt Rodehav
Hello Pinaki, Thanks for looking into this. What you are suggesting seems useful and it would be really nice if this functionality is supported in the future. However, I can't see how it directly solves my problem. What I'm trying to do in my audit log is to save a serialized form of my entity -

Re: Audit log with OpenJPA

2011-07-26 Thread Bengt Rodehav
Yes, you're right Pinaki. I've attached a test case to the JIRA now. I'm very interested in your verdict... /Bengt 2011/7/26 Pinaki Poddar ppod...@apache.org Hi Bengt, This thread has grown too lengthy for me to find where was the @PreUpdate code. For better convergence, please create a

Re: Audit log with OpenJPA

2011-07-25 Thread Bengt Rodehav
. The reason is that mandatory values are missing. Values that exist in the persisted entity (variable bu) but are not updated. If I remove the audit logging from my @PreUpdate method, the JUnit test case succeeds. Any clues? /Bengt 2011/7/21 Bengt Rodehav be...@rodehav.com I'm currently

Re: Audit log with OpenJPA

2011-07-21 Thread Bengt Rodehav
I'm currently in Turkey on vacation but will try when I get back to Sweden. /Bengt Den 19 jul 2011 17:48 skrev Pinaki Poddar ppod...@apache.org: Hi Bengt, It is not obvious to me how DetachState related options will impact in-transaction entities. But I am interested to know the result of your

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-16 Thread Bengt Rodehav
Did you have a suggestion regarding this Pinaki - or does OpenJPA only keep track of changed values - not the whole original object? /Bengt 2011/7/15 Bengt Rodehav be...@rodehav.com I don't understand Pinaki. The this pointer is the current version of the object (the one that is about

Re: Audit log with OpenJPA

2011-07-15 Thread Bengt Rodehav
I don't understand Pinaki. The this pointer is the current version of the object (the one that is about to be persisted) right? I want the previous version of the object. I have used your code from the blog (and added some of course) like this: * PersistenceCapable currentState =

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 Bengt Rodehav
Pinaki, Thanks for your very insightful post. It feels like this is the way to go then. I'll stick with this approach for now and try to follow the development of JPA and OpenJPA. Thanks for your help, /Bengt 2011/7/14 Pinaki Poddar ppod...@apache.org Jim, I was making generic statements

Re: Audit log with OpenJPA

2011-07-14 Thread Bengt Rodehav
(the previous version of the object that is)? /Bengt 2011/7/14 Bengt Rodehav be...@rodehav.com Pinaki, Thanks for your very insightful post. It feels like this is the way to go then. I'll stick with this approach for now and try to follow the development of JPA and OpenJPA. Thanks for your

Re: Audit log with OpenJPA

2011-07-13 Thread Bengt Rodehav
Pinaki, I agree with all your statements. I would like to keep the audit logging out of my business domain (separating of concerns). I just hadn't found a good way of doing this with JPA yet. Jim's approach gave me a way of being able to create new entities in @PreUpdate however with the

Re: Audit log with OpenJPA

2011-07-13 Thread Bengt Rodehav
Just tried your suggestion Pinaki - it works fine and I can keep the audit logging completely separate from my domain model. I even get rid of the join table. Now if this were clearly supported by OpenJPA (and by JPA in the future) I think we have a clear winner... /Bengt 2011/7/14 Bengt

Re: Audit log with OpenJPA

2011-07-12 Thread Bengt Rodehav
of doing things. My guess is yes since you don't actually use the entity manager yourself. Very interesting approach. Thanks, /Bengt 2011/7/12 Jim Talbut jtal...@spudsoft.co.uk On 07/07/2011 12:05, Bengt Rodehav wrote: I'm using OpenJPA for persistence and would like to audit log any

Re: Audit log with OpenJPA

2011-07-12 Thread Bengt Rodehav
2011/7/12 Jim Talbut jtal...@spudsoft.co.uk On 12/07/2011 08:49, Bengt Rodehav wrote: Your other design decision is also interesting. By having a relationship to the audit log entries JPA will persist the audit log entry for you - very convenient indeed. A little similar to the way Pinaki

Re: Audit log with OpenJPA

2011-07-12 Thread Bengt Rodehav
) { AuditLog al = new AuditLog(); al.setLogEntry(serialization of object); auditLog.add(al); } } OpenJPA doesn't seem to like this. What did you do differently? /Bengt 2011/7/12 Bengt Rodehav be...@rodehav.com OK - I didn't know that. I agree that it would be nice if the OpenJPA

Re: Audit log with OpenJPA

2011-07-08 Thread Bengt Rodehav
Indeed very interesting stuff (JEST). I'm not sure whether I want straight lines from the client to the persistence layer though. Normally you would want a layer in between for adding business logic, security etc. What is interesting is to send general queries from the client to the server and

Re: Audit log with OpenJPA

2011-07-08 Thread Bengt Rodehav
Pinaki, Can you point me to where I can find documentation about acessing the entity manager from the life cycle callbacks? Will it be supported in OpenJPA in the future? Can I rely on it? /Bengt 2011/7/8 Pinaki Poddar ppod...@apache.org you actually store it in the object itself. That's

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 Bengt Rodehav
the complexity significantly (also regarding testing). Thanks, /Bengt 2011/7/7 Jari Fredriksson ja...@iki.fi 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

Re: Audit log with OpenJPA

2011-07-07 Thread Bengt Rodehav
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 audit logging

Re: Audit log with OpenJPA

2011-07-07 Thread Bengt Rodehav
-Andy On Thu, 2011-07-07 at 15:35 +0100, David Goodenough wrote: 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

Re: Audit log with OpenJPA

2011-07-07 Thread Bengt Rodehav
, 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 makes a lot of sense when trying to achieve high throughput since the audit logging can then be done on lower priority

Re: Audit log with OpenJPA

2011-07-07 Thread Bengt Rodehav
it with XML because boss wanted so, but could have been database as well. 7.7.2011 19:49, Bengt Rodehav kirjoitti: 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

Re: Audit log with OpenJPA

2011-07-07 Thread Bengt Rodehav
process. -=- Jerry On Jul 7, 2011, at 12:50 PM, Bengt Rodehav [via OpenJPA] wrote: 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

Re: Audit log with OpenJPA

2011-07-07 Thread Bengt Rodehav
Again an interesting approach. It's very similar to the way we did it in the old days (before O/R mappers were abundant). We rolled our own O/R mapping and also compared the previous state with the new state and saved the difference (XML in the database). I guess the same approach can be taken if

Re: Audit log with OpenJPA

2011-07-07 Thread Bengt Rodehav
Again an interesting solution. Although, as I wrote previously, I intend to store the whole object and therefore don't need to keep track of what has changed. I intend to do a JSON diff when viewing the audit log in the GUI instead. Your approach does, however, very elegantly solve the problem of

Base entity class in separate jar

2010-09-17 Thread Bengt Rodehav
I'm using OpenJPA 2.0.1. All my entities share some common properties like: - createdBy - createdWhen - updatedBy - updatedWhen - version - id I therefore create a superclass (EntityBase) that contains these properties. It is an abstract class annotated with @MappedSuperclass. However, I'm not

Re: Base entity class in separate jar

2010-09-17 Thread Bengt Rodehav
is your application being packaged and what runtime environment are you using? For enhancing in Maven, you can try the openjpa-maven-plugin http://openjpa.apache.org/enhancement-with-maven.html but use openjpa version 2.0.1 instead of 1.2.2 as on the wiki. -Donald On 9/17/10 3:13 AM, Bengt