Re: OpenJPA support for JPA 2.1: when?

2013-06-17 Thread Georgi Naplatanov

Hi Glen

It's not bad that in this project participate people form IBM, it's bad 
that there are not people from other companies. As far as I notice 
people form Oracle haven't participated in this project since OpenJPA 1.x.


Java belongs to big companies and in my country is very rarely some 
small company to use something written in Java except for products what 
are ready for use in their business.


How is the situation in your country ?

Best regards
Georgi

On 06/17/2013 05:49 PM, Glen Mazza wrote:

One concern I have for OpenJPA is that the vast majority of committers
are IBM or Oracle people, which can give pause to people thinking about
contributing (i.e., the impression that committership is closed to
IBMers or Oracle people alone), that they may be better off submitting
patches to another Apache project instead. Apache Xalan may have been in
a similar situation in the past as virtually all committers were IBMers,
causing one to think the project is a closed shop and not getting many
external contributions or new people to help out as a result. Without an
open community, you may not get the resources to implement JPA 2.1,
similar to Xalan's resource problems in implementing XSLT 2.0 today.

Glen

On 06/13/2013 10:52 PM, Matthew Adams wrote:

responses inline...

On Thu, Jun 13, 2013 at 2:27 PM, Kevin Sutter  wrote:


Good question, Matthew. This has been brought up a couple of different
times...

http://openjpa.208410.n2.nabble.com/JPA-2-1-td7215602.html

http://openjpa.208410.n2.nabble.com/DISCUSSION-JPA-2-1-spec-implementation-td7581978.html


So, there's been some interest, but not an overwhelming interest. Not to
the point of creating a team, figuring out the work effort, and
divvying up
the responsibilities. Contrast that with the JPA 2.0 development effort,
and there was overwhelming community support and participation. So, I
think there are a handful of us interested in a JPA 2.1
implementation, but
more participation is required.

Pardon my surprise, but that sounds just plain bad. That kind of

sentiment threatens to scare users away, IMHO. I have always held OpenJPA
in high esteem as one of the major, credible implementations because it's
always been up to date WRT to the specs (and, let's not kid ourselves, it
hails from Kodo JDO). Frankly, the specs don't move very fast, and at
least previews of them are available well in advance of the actual GA
releases.



Pinaki has went so far to create a sandbox and start experimenting
with an
implementation. Again, he's a one-man show and can't do it all. Well, he
probably could, but it would require a bit of work... :-)

https://svn.apache.org/repos/asf/openjpa/sandboxes/21

Well, I would have expected a team of folks on this, not just one. After

all, Pinaki was arguing for expanded fetch plan capabilities in the JPA
expert group based on OpenJPA's current capabilities -- and rightfully
so,
I might add.

Maybe we should resurrect that [DISCUSSION] topic


I think you should. Especially with any support customers you or the
OpenJPA project sponsors may have.



but I'm curious what
features of JPA 2.1 are of most interest to you? Or, is it just a matter
of being consistent with the latest specification?

One feature that's worth its development weight is fetch plans, which

OpenJPA, thanks to its current fetch plan implementation, can implement
fairly quickly. Further, OpenJPA's fetch plan support exceeds JPA's
requirement with fetch depth and recursion depth!

Additionally, I just happen to be writing an advanced JPA course right
now,
and customers of this course want to use the JPA implementation in the
course that they have settled on in their organization. It just so
happens
that the maiden voyage of this course covers JPA 2.1 and is for a
customer
that is also an OpenJPA customer. And they're large. Now, I have to tell
them "Sorry, OpenJPA doesn't have plans to implement JPA 2.1". Can you
say, "Bye bye, customer"? EclipseLink & DataNucleus already implement
2.1,
and Hibernate's implementation is in progress. If not for the technical
reasons I gave above, then the need to remain competitive should be
enough
to have you assemble a crack 2.1 team ASAP. Don't forget about BatooJPA
making noise (claiming top performance, although I take that with a few
grains of salt) and the NoSQL JPA implementations (DataNucleus, ObjectDB,
and Kundera), not to mention the Spring Data projects. Like it or not,
you
are beset on all sides with competition.

Just my $0.02, which might just be worth around $0.029 with the interest
I've accumulated since working with JDO- & JPA-style lightweight
persistence since 1996 and with the expert groups since 2000.

Thanks,

Kevin


On Thu, Jun 13, 2013 at 2:03 PM, Matthew Adams 
wrote:
When will OpenJPA support JPA 2.1?

-matthew

--
mailto:matt...@matthewadams.me 
skype:matthewadams12
googletalk:matt...@matthewadams.me
http://matthewadams.me
http://www.linkedin.com/in/matthewadams








Re: Get database password for persistence.xml from external file

2012-05-29 Thread Georgi Naplatanov

Hi.

You can mix properties in persistence.xml file and additional 
properties. Look at


public static EntityManagerFactory createEntityManagerFactory(String 
persistenceUnitName,Map properties)


method.

HTH

Best regards
Georgi

On 05/29/2012 04:16 PM, vinbr88 wrote:

Hello,

my application is using the persistence.xml for connecting to our Oracle
test database. The password is inserted there like this:








On the target system, the database password changes every 90 days. The
system automatically creates a property file for every user on the Linux
file system with his new password in there. Our applications read and use
the password of this property file on the file system.

Is there a possibility to use this file for connecting to the database via
openJPA/Oracle JDBC driver. Or do you know a possibility to import the
password of the property file into the persistence.xml?

Thank you in advance.

Vince


--
View this message in context: 
http://openjpa.208410.n2.nabble.com/Get-database-password-for-persistence-xml-from-external-file-tp7579412.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


release notes for OpenJPA 2.1.1

2011-07-28 Thread Georgi Naplatanov

Hi all.

Release notes for OpenJPA 2.1.1 is not available at download page.

page - http://openjpa.apache.org/downloads.html
link - 
http://openjpa.apache.org/builds/2.1.1/apache-openjpa-2.1.1/RELEASE-NOTES.html


Fix it, please.

Best regards
Georgi


Re: OpenJPA and ehcache configuration

2011-03-08 Thread Georgi Naplatanov

Hi revathy.

>Do u have any idea to invalidate the cache value in Ehcache?
I have not.

Regards
Georgi

On 03/08/2011 10:32 AM, revathy wrote:


Hi Georgi,
   Do u have any idea to invalidate the cache value in Ehcache?


From: Georgi Naplatanov [via OpenJPA] 
[mailto:ml-node+6097014-828808144-322...@n2.nabble.com]
Sent: Monday, March 07, 2011 5:30 PM
To: Revathy Pandian
Subject: Re: OpenJPA and ehcache configuration

Hi revathy.

Put Ehcache.xml file in the "WEB-INF/classes/" folder in case it is a
web application.

Regards
Georgi

On 03/07/2011 01:46 PM, revathy wrote:


Hi Georgi,

 Thank you very much.
It s working. But the warning it shows as
"WARNING: No configuration found. Configuring ehcache from ehcache-failsafe.xml  
found in the classpath: 
jar:file:/D:/workspace/HeliosWorkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/EHcachePOC/WEB-INF/lib/ehcache-core-2.3.1.jar!/ehcache-failsafe.xml"

I have added ehcache.xml in class path, It is in lib folder now. But it s not 
taking that xml.

Do u have any idea.

From: Georgi Naplatanov [via OpenJPA] [mailto:[hidden 
email]]
Sent: Monday, March 07, 2011 4:55 PM
To: Revathy Pandian
Subject: Re: OpenJPA and ehcache configuration

Hi revathy.

1. My persistence.xml file looks like :

  

  


2. Ehcache.xml has to be in the classpath, not in Metainf folder.

3. I use 0.2.0 version of Ehcache OpenJPA plugin
(ehcache-openjpa-0.2.0.jar).

HTH

Regards
Georgi

On 03/07/2011 11:35 AM, revathy wrote:


Hi Georgi,

  Can you help me to make OpenJPA work with Ecache??
I have done the following configurations.


1.   In Persistence.xml ,
 

  

  

2.  Ehcache.xml is placed in Metainf folder.

3.  ehcache-openjpa-0.1.jar, ehcache-core-2.3.1.jar, slf4j-api-1.5.11.jar, 
slf4j-jdk14-1.6.1.jar are in the classpath.

But Ehacahe is not working for me.

Please help me out


From: Georgi Naplatanov [via OpenJPA] [mailto:[hidden 
email]]
Sent: Monday, March 07, 2011 2:46 PM
To: Revathy Pandian
Subject: Re: OpenJPA and ehcache configuration

Hi revathy.

I use the following jar files :

 - ehcache-core-2.2.0.jar
 - slf4j-api-1.5.11.jar
 - slf4j-jdk14-1.5.11.jar
 - ehcache-openjpa-0.2.0.jar (Ehcache OpenJPA plugin)

Regards
Georgi

On 03/07/2011 08:53 AM, revathy wrote:

Hi,

   Can u tell me what jar u are using to make this configuration works??

--
View this message in context: 
http://openjpa.208410.n2.nabble.com/OpenJPA-and-ehcache-configuration-tp5622421p6096335.html<http://openjpa.208410.n2.nabble.com/OpenJPA-and-ehcache-configuration-tp5622421p6096335.html?by-user=t><http://openjpa.208410.n2.nabble.com/OpenJPA-and-ehcache-configuration-tp5622421p6096335.html%3chttp:/openjpa.208410.n2.nabble.com/OpenJPA-and-ehcache-configuration-tp5622421p6096335.html?by-user=t%3e&by-user=t><http://openjpa.208410.n2.nabble.com/OpenJPA-and-ehcache-configuration-tp5622421p6096335.html%3chttp:/openjpa.208410.n2.nabble.com/OpenJPA-and-ehcache-configuration-tp5622421p6096335.html?by-user=t%3e%3chttp://openjpa.208410.n2.nabble.com/OpenJPA-and-ehcache-configuration-tp5622421p6096335.html%3chttp:/openjpa.208410.n2.nabble.com/OpenJPA-and-ehcache-configuration-tp5622421p6096335.html?by-user=t%3e&by-user=t%3e&by-user=t>
Sent from the OpenJPA Users mailing list archive at Nabble.com.



If you reply to this email, your message will be added to the discussion below:
http://openjpa.208410.n2.nabble.com/OpenJPA-and-ehcache-configuration-tp5622421p6096581.html<http://openjpa.208410.n2.nabble.com/OpenJPA-and-ehcache-configuration-tp5622421p6096581.html?by-user=t><http://openjpa.208410.n2.nabble.com/OpenJPA-and-ehcache-configuration-tp5622421p6096581.html%3chttp:/openjpa.208410.n2.nabble.com/OpenJPA-and-ehcache-configuration-tp5622421p6096581.html?by-user=t%3e&by-user=t>




http://www.mindtree.com/email/disclaimer.html


--
View this message in context: 
http://openjpa.208410.n2.nabble.com/OpenJPA-and-ehcache-configuration-tp5622421p6096634.html<http://openjpa.208410.n2.nabble.com/OpenJPA-and-ehcache-configuration-tp5622421p6096634.html?by-user=t><http://openjpa.208410.n2.nabble.com/OpenJPA-and-ehcache-configuration-tp5622421p6096634.html%3chttp:/openjpa.208410.n2.nabble.com/OpenJPA-and-ehcache-configuration-tp5622421p6096634.html?by-user=t%3e&by-user=t>
Sent from the OpenJPA Users mailing list archive at Nabble.com.



If you reply to this email, your message will be added to the discussion below:
http://openjpa.208410.n2.nabble.com/OpenJPA-and-ehcache-configuration-tp5622421p6096908.html<http://openjpa.208410.n2.nabble.com/OpenJPA-and-ehcache-configuration-tp5622421p6096908.html?by-user=t>



--
View this message in context: 
http://openjpa.208410.n2.nabble.com/OpenJPA-and-ehcache-configuration-t

Re: OpenJPA and ehcache configuration

2011-03-07 Thread Georgi Naplatanov

Hi revathy.

Put Ehcache.xml file in the "WEB-INF/classes/" folder in case it is a 
web application.


Regards
Georgi

On 03/07/2011 01:46 PM, revathy wrote:

Hi Georgi,

Thank you very much.
It s working. But the warning it shows as
"WARNING: No configuration found. Configuring ehcache from ehcache-failsafe.xml  
found in the classpath: 
jar:file:/D:/workspace/HeliosWorkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/EHcachePOC/WEB-INF/lib/ehcache-core-2.3.1.jar!/ehcache-failsafe.xml"

I have added ehcache.xml in class path, It is in lib folder now. But it s not 
taking that xml.

Do u have any idea.

From: Georgi Naplatanov [via OpenJPA] 
[mailto:ml-node+6096908-737609752-322...@n2.nabble.com]
Sent: Monday, March 07, 2011 4:55 PM
To: Revathy Pandian
Subject: Re: OpenJPA and ehcache configuration

Hi revathy.

1. My persistence.xml file looks like :

 

 


2. Ehcache.xml has to be in the classpath, not in Metainf folder.

3. I use 0.2.0 version of Ehcache OpenJPA plugin
(ehcache-openjpa-0.2.0.jar).

HTH

Regards
Georgi

On 03/07/2011 11:35 AM, revathy wrote:


Hi Georgi,

 Can you help me to make OpenJPA work with Ecache??
I have done the following configurations.


1.   In Persistence.xml ,


 

 

2.  Ehcache.xml is placed in Metainf folder.

3.  ehcache-openjpa-0.1.jar, ehcache-core-2.3.1.jar, slf4j-api-1.5.11.jar, 
slf4j-jdk14-1.6.1.jar are in the classpath.

But Ehacahe is not working for me.

Please help me out


From: Georgi Naplatanov [via OpenJPA] [mailto:[hidden 
email]]
Sent: Monday, March 07, 2011 2:46 PM
To: Revathy Pandian
Subject: Re: OpenJPA and ehcache configuration

Hi revathy.

I use the following jar files :

- ehcache-core-2.2.0.jar
- slf4j-api-1.5.11.jar
- slf4j-jdk14-1.5.11.jar
- ehcache-openjpa-0.2.0.jar (Ehcache OpenJPA plugin)

Regards
Georgi

On 03/07/2011 08:53 AM, revathy wrote:

Hi,

  Can u tell me what jar u are using to make this configuration works??

--
View this message in context: 
http://openjpa.208410.n2.nabble.com/OpenJPA-and-ehcache-configuration-tp5622421p6096335.html<http://openjpa.208410.n2.nabble.com/OpenJPA-and-ehcache-configuration-tp5622421p6096335.html?by-user=t><http://openjpa.208410.n2.nabble.com/OpenJPA-and-ehcache-configuration-tp5622421p6096335.html%3chttp:/openjpa.208410.n2.nabble.com/OpenJPA-and-ehcache-configuration-tp5622421p6096335.html?by-user=t%3e&by-user=t>
Sent from the OpenJPA Users mailing list archive at Nabble.com.



If you reply to this email, your message will be added to the discussion below:
http://openjpa.208410.n2.nabble.com/OpenJPA-and-ehcache-configuration-tp5622421p6096581.html<http://openjpa.208410.n2.nabble.com/OpenJPA-and-ehcache-configuration-tp5622421p6096581.html?by-user=t>




http://www.mindtree.com/email/disclaimer.html


--
View this message in context: 
http://openjpa.208410.n2.nabble.com/OpenJPA-and-ehcache-configuration-tp5622421p6096634.html<http://openjpa.208410.n2.nabble.com/OpenJPA-and-ehcache-configuration-tp5622421p6096634.html?by-user=t>
Sent from the OpenJPA Users mailing list archive at Nabble.com.



If you reply to this email, your message will be added to the discussion below:
http://openjpa.208410.n2.nabble.com/OpenJPA-and-ehcache-configuration-tp5622421p6096908.html
To unsubscribe from OpenJPA and ehcache configuration, click 
here<http://openjpa.208410.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5622421&code=cmV2YXRoeV9wYW5kaWFuQG1pbmR0cmVlLmNvbXw1NjIyNDIxfDc5MjQxMTA0>.


--
View this message in context: 
http://openjpa.208410.n2.nabble.com/OpenJPA-and-ehcache-configuration-tp5622421p6096977.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Re: OpenJPA and ehcache configuration

2011-03-07 Thread Georgi Naplatanov

Hi revathy.

1. My persistence.xml file looks like :






2. Ehcache.xml has to be in the classpath, not in Metainf folder.

3. I use 0.2.0 version of Ehcache OpenJPA plugin 
(ehcache-openjpa-0.2.0.jar).


HTH

Regards
Georgi

On 03/07/2011 11:35 AM, revathy wrote:

Hi Georgi,

Can you help me to make OpenJPA work with Ecache??
I have done the following configurations.


1.   In Persistence.xml ,
   





2.  Ehcache.xml is placed in Metainf folder.

3.  ehcache-openjpa-0.1.jar, ehcache-core-2.3.1.jar, slf4j-api-1.5.11.jar, 
slf4j-jdk14-1.6.1.jar are in the classpath.

But Ehacahe is not working for me.

Please help me out


From: Georgi Naplatanov [via OpenJPA] 
[mailto:ml-node+6096581-2017424-322...@n2.nabble.com]
Sent: Monday, March 07, 2011 2:46 PM
To: Revathy Pandian
Subject: Re: OpenJPA and ehcache configuration

Hi revathy.

I use the following jar files :

   - ehcache-core-2.2.0.jar
   - slf4j-api-1.5.11.jar
   - slf4j-jdk14-1.5.11.jar
   - ehcache-openjpa-0.2.0.jar (Ehcache OpenJPA plugin)

Regards
Georgi

On 03/07/2011 08:53 AM, revathy wrote:

Hi,

 Can u tell me what jar u are using to make this configuration works??

--
View this message in context: 
http://openjpa.208410.n2.nabble.com/OpenJPA-and-ehcache-configuration-tp5622421p6096335.html<http://openjpa.208410.n2.nabble.com/OpenJPA-and-ehcache-configuration-tp5622421p6096335.html?by-user=t>
Sent from the OpenJPA Users mailing list archive at Nabble.com.



If you reply to this email, your message will be added to the discussion below:
http://openjpa.208410.n2.nabble.com/OpenJPA-and-ehcache-configuration-tp5622421p6096581.html
To unsubscribe from OpenJPA and ehcache configuration, click 
here<http://openjpa.208410.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5622421&code=cmV2YXRoeV9wYW5kaWFuQG1pbmR0cmVlLmNvbXw1NjIyNDIxfDc5MjQxMTA0>.



http://www.mindtree.com/email/disclaimer.html


--
View this message in context: 
http://openjpa.208410.n2.nabble.com/OpenJPA-and-ehcache-configuration-tp5622421p6096634.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Re: OpenJPA and ehcache configuration

2011-03-07 Thread Georgi Naplatanov

Hi revathy.

I use the following jar files :

 - ehcache-core-2.2.0.jar
 - slf4j-api-1.5.11.jar
 - slf4j-jdk14-1.5.11.jar
 - ehcache-openjpa-0.2.0.jar (Ehcache OpenJPA plugin)

Regards
Georgi

On 03/07/2011 08:53 AM, revathy wrote:

Hi,

Can u tell me what jar u are using to make this configuration works??

--
View this message in context: 
http://openjpa.208410.n2.nabble.com/OpenJPA-and-ehcache-configuration-tp5622421p6096335.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Re: JPAB results

2010-11-08 Thread Georgi Naplatanov

Hello Ilan.

You can consider to switch on statement pooling. Just add to property 
"openjpa.ConnectionProperties" "poolPreparedStatements=true".


Best regards
Georgi

Ilan Kirsh wrote:

Hi Pinaki,

Thank you for the reference.

Could you please verify the following persistence.xml file (which seems to
run fine) before I run the entire benchmark again?


http://java.sun.com/xml/ns/persistence";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"; version="2.0">
  
   
org.apache.openjpa.persistence.PersistenceProviderImpl

org.jpab.basic.Person
org.jpab.col.CollectionPerson
org.jpab.ext.PersonBase
org.jpab.ext.PersonExt
org.jpab.ext.PersonExtExt
org.jpab.index.IndexedPerson
org.jpab.node.Node

  
  
  
  
  
  

  



Regarding your previous post:


Pinaki Poddar wrote:

"A huge performance gap has been detected when using simple basic entities
with small transaction/retrieval size. Comparing the normalized speed of
OpenJPA with MySQL database server (0.15) to the normalized speed of
Hibernate with MySQL database server (8.5) reveals that in that case,
Hibernate with MySQL server is 56.7 times faster than OpenJPA with MySQL
server. "

All the OpenJPA users out there must be real dumb and must immediately
switch to something that is 56.7 times faster. Or not. When a benchmark
developer reports such drastic results -- they would be better off to
double-check their observations -- given that both the vendors had been in
operation for quite a while and users are *not* dumb. Actually such
drastic observations degrade one's confidence in these reported numbers
despite of them being presented with panache. 



Please notice that 56.7 refers to an extreme edge case that has been
detected automatically (this is a machine generated analysis) and not to the
average performance gap.

But if you look now at the new results:
http://temp.jpab.org/OpenJPA_R2/MySQL/server/Hibernate/MySQL/server.html
you can see that the maximum gap is now only 6 (the 56.7 has gone).

Since I spent a lot of time in the last years on performance and
optimizations, I know that a factor of 56 is not unusual. Look for example
at:
http://temp.jpab.org/OpenJPA/PostgreSQL/server/OpenJPA_R2/PostgreSQL/server.html#All
You can see a performance gap of x200 - when comparing OpenJPA with
PostreSQL to itself. One run with the OpenJPA 2.0 and out of the box
configuration and the other run with OpenJPA 2.1 and some tuning.

Jerry's observation should be taken in this context:


No1UNo wrote:
This test suite was clearly designed around the strengths of ObjectDB. 
The factor of six between the 'ObjectDB server' and 'Hibernate with

PostgreSQL server' performance is just not credible otherwise.



Since ObjectDB requires much less processing (no JPA-JDBC-SQL-Database
layers and most of the time complete objects are processed as atomic byte[]
elements, rather than as collections of fields) - a factor of 6 looks very
reasonable. You can see that even the same product might produce a much
larger factor of 200.

Best regards,
Ilan




Re: JPAB results

2010-11-05 Thread Georgi Naplatanov

Hi Ilan.

Do not forget to enable statement pooling in database connection pool 
configuration, if it is not enabled by default.


Best regards
Georgi

Jeremy Bauer wrote:

Hi Ilan,

Thanks for your post, additional details about JPAB, and your willingness to
try different OpenJPA configurations.  While the performance gap is
concerning, myself and others are especially concerned with the functional
problems you are seeing.  I downloaded the benchmark jar and was able to
reproduce the errors you've documented.  Running the multi-threaded tests
with OpenJPA 2.0.0 on a multi-core system consistently produced duplicate
key exceptions.  I found that this issue is fixed in our 2.0.2-SNAPSHOT and
also in 2.1.0-SNAPSHOT/trunk.  However, the 2.0.2 snapshot runs into another
threading issue, which is caused by OpenJPA's QuerySQLCache.  By disabling
the cache with the property below, I was able to get a clean run with
2.0.2-SNAPSHOT.  Current trunk level code has some fixes in this area and
worked without it.

property-3=

I am doing a bit of experimentation with the benchmark in the areas of
connection pooling, data caching, and statement batching.  While OpenJPA has
many performance tuning switches and dials, these three typically have the
most impact.  Some of the other providers have these performance features
enabled by default, so enabling them in OpenJPA helps level the field.

If you have time and wouldn't mind giving OpenJPA another go, you can get
the latest 2.1.0-SNAPSHOT from here:
https://repository.apache.org/snapshots/org/apache/openjpa/apache-openjpa/2.1.0-SNAPSHOT/

as of this note the latest snapshot is
https://repository.apache.org/snapshots/org/apache/openjpa/apache-openjpa/2.1.0-SNAPSHOT/apache-openjpa-2.1.0-20101104.065025-93-binary.zip

This snapshot has connection pooling included and enabled by default.  If
you'd like, you can enable basic, un-tuned, statement batching and data
caching with these properties.

property-3=
property-4=

I and I'm sure others others would be interested in the result.  If I come
up with a better set of basic tuning parameters, I'll pass them along.
Others, please feel free to do the same.

-Jeremy

On Wed, Nov 3, 2010 at 11:24 AM, Ilan Kirsh  wrote:


Hi all,

I am the author of the  http://www.jpab.org JPAB benchmark .

As Rick wrote - this is indeed an out of the box benchmark. Default
configuration was used for all the tested products.

I read with interest what you said about connection pooling. I am keen to
try this but I wonder whether it will really make a difference because the
tests do not use short term database connections, and anyway, the time of
connecting to the database is excluded from the time measurement.

But probably there are other things that can be done to improve
performance.
I'd like to run the tests again with optimized OpenJPA configuration but
for
this I will need some help from OpenJPA experts.

Regarding test failures - I have used standard JPA for the tests. I am
obviously keen to fix up any problems which are my errors, though, so I'd
be
very happy for details I have got incorrect to be pointed out and fixed.

However, please notice that the same tests that failed with OpenJPA passes
with other combinations such as Hibernate/MySQL. Therefore, this could
really be a problem with the OpenJPA processing, as Kevin wrote. I think
that these tests indicate at least some issues that might have to be fixed
in OpenJPA.

Finally, I'd like to address any concerns that the tests are specifically
designed to make  http://www.objectdb.com ObjectDB  look best. The tests
are
very simple and include only standard JPA operations on simple object
models. It is open source - does anyone see anything that is biased towards
ObjectDB performance?  Actually, the performance gap could be even larger
if
the object model would be more complex. It is true, however, as explained
on
http://www.jpab.org/Benchmark_FAQ.html, that when the bottleneck is disk
activity or network overhead - performance gaps are expected to be much
lower.

Best regards,
Ilan Kirsh
--
View this message in context:
http://openjpa.208410.n2.nabble.com/JPAB-results-tp5693298p5702044.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.







Re: JPAB results

2010-11-02 Thread Georgi Naplatanov

Hi gkorland.

Do not trust on this tests. It is better to make your own test and then 
decide  which implementation is good for you.


My testing indicates that OpenJPA (with or without cache) is faster than 
Hibernate on mostly write and less read operations.


On read operation probably all JPA implementation are very close due the 
 cache.


Best regards
Georgi

gkorland wrote:
Did anyone review the JPAB (http://www.jpab.org/) results? 
It seems like all the other JPA guys are running faster and even better...




Problems with trunk build

2010-11-01 Thread Georgi Naplatanov

Hi all.

I have the following problems when i try to build OpenJPA from trunk:

1. After "mvn compile" execution the following error occurs :

[ERROR] BUILD ERROR
[INFO] 

[INFO] An Ant BuildException has occured: The following error occurred 
while executing this line:
/home/gosho/eclipse_workplaces/openjpa/trunk/openjpa-examples/openbooks/build.xml:116: 
*** Error:
   The directory for OpenJPA libraries can not be 
located at 
/home/gosho/.m2/repository/org/apache/openjpa/openjpa-all/2.1.0-SNAPSHOT.
   Make sure openjpa.lib property value is correct in 
build.properties file.


2. After "mvn package -DskipTests" execution - the same error as above

3. If i change HSQLDictionary.java file for example, the compiled file 
is in "trunk/openjpa-jdbc/target/classes/org/apache/openjpa/jdbc/sql" 
directory which is correct, but in the 
"trunk/openjpa-project/target/site/downloads/apache-openjpa-2.1.0-SNAPSHOT-binary.zip" 
is unmodified file.


What is wrong ?

Best regards
Georgi


Re: OpenJPA and ehcache configuration

2010-10-11 Thread Georgi Naplatanov

Hello Kevin.

This configuration works fine for me, but I was not sure about all 
configuration parameters. Now all is clear.


Thanks for your replay.

Best regards
Georgi

Kevin Sutter wrote:

Hi Georgi,
Your configuration looks right.  Are you experiencing problems with this
configuration?  I'm not positive that the ehcache team has done verification
testing with OpenJPA 2.1.x, but the plug point should still work just fine.
Let us know if you experience problems.

FYI, the QueryCompilationCache and QuerySQLCache are "on" by default, so
there's no reason to include the "true" settings in your persistence.xml for
these two properties.

The "ehcache" settings are special values that signal to the ehcache plugin
to set the other cache-related properties accordingly.  That's why you do
not need to set the RemoteCommitProvider and DataCache properties
explicitly.

Good luck,
Kevin


On Mon, Oct 11, 2010 at 4:11 AM, Georgi Naplatanov  wrote:


Hi all.

I want to configure ehcache 2.2.0, OpenJPA plugin for ehcache 0.2 and
OpenJPA 2.1-snapshot.

Below are my configuration files, but I am not sure that it's right
configuration.

persistence.xml







ehcache.xml



   

   
   

   
   



Is this configuration correct ?

Should I configure :
   - "openjpa.DataCache" and "openjpa.RemoteCommitProvider" in
persistence.xml
   - additional cache names in ehcache.xml

Best regards
Georgi







OpenJPA and ehcache configuration

2010-10-11 Thread Georgi Naplatanov

Hi all.

I want to configure ehcache 2.2.0, OpenJPA plugin for ehcache 0.2 and 
OpenJPA 2.1-snapshot.


Below are my configuration files, but I am not sure that it's right 
configuration.


persistence.xml







ehcache.xml













Is this configuration correct ?

Should I configure :
- "openjpa.DataCache" and "openjpa.RemoteCommitProvider" in 
persistence.xml
- additional cache names in ehcache.xml

Best regards
Georgi


Re: strange warning after upgrade OpenJPA from 1.2.0 to 2.0.1

2010-09-29 Thread Georgi Naplatanov

Hi Eric.

You are right. I replaced OpenJPA 2.0.1 with 2.1.0-snapshot and warning 
message is gone.


Thank you.

Best regards
Georgi

Eric Charles wrote:

Hi,
May be related to this thread?
http://markmail.org/message/u3flgv3yux7djg6i
Tks,
Eric


On 27/09/2010 13:53, Georgi Naplatanov wrote:

Hello list.

I have following warning after upgrading of OpenJPA From 1.2.0 to 2.0.1

 6509  OpenCmsJPAPool  WARN   [main] openjpa.Runtime - Supplied user 
parameters "[1, 2, 3]" do not match expected parameters "[1, 3]" for 
the prepared query "PreparedQuery: [SELECT T_CmsDAOGroups, 
T_CmsDAOGroupUsers FROM CmsDAOGroups T_CmsDAOGroups, CmsDAOGroupUsers 
T_CmsDAOGroupUsers WHERE T_CmsDAOGroupUsers.m_userId=?1 AND 
T_CmsDAOGroups.m_groupId=T_CmsDAOGroupUsers.m_groupId AND 
T_CmsDAOGroups.m_groupOu LIKE ?2 AND T_CmsDAOGroups.m_groupFlags >= ?3 
ORDER BY T_CmsDAOGroups.m_groupOu, T_CmsDAOGroups.m_groupName] --> 
[SELECT t1.group_id, t0.group_id, t0.user_id, t1.group_ou, 
t1.group_name FROM public.cms_groupusers t0, public.cms_groups t1 
WHERE (t0.user_id = ? AND t1.group_id = t0.group_id AND t1.group_ou 
LIKE ? ESCAPE '\\' AND t1.group_flags >= ?) ORDER BY t1.group_ou ASC, 
t1.group_name ASC]".


I checked and query parameters type match.

It is the java code :

Query q = .. ;

q.setParameter(1, userId.toString()); // string
q.setParameter(2, ouFqnParam); // string
q.setParameter(3, I_CmsPrincipal.FLAG_GROUP_ROLE); // int

What is wrong ?

TIA

Best regards
Georgi






strange warning after upgrade OpenJPA from 1.2.0 to 2.0.1

2010-09-27 Thread Georgi Naplatanov

Hello list.

I have following warning after upgrading of OpenJPA From 1.2.0 to 2.0.1

 6509  OpenCmsJPAPool  WARN   [main] openjpa.Runtime - Supplied user 
parameters "[1, 2, 3]" do not match expected parameters "[1, 3]" for the 
prepared query "PreparedQuery: [SELECT T_CmsDAOGroups, 
T_CmsDAOGroupUsers FROM CmsDAOGroups T_CmsDAOGroups, CmsDAOGroupUsers 
T_CmsDAOGroupUsers WHERE T_CmsDAOGroupUsers.m_userId=?1 AND 
T_CmsDAOGroups.m_groupId=T_CmsDAOGroupUsers.m_groupId AND 
T_CmsDAOGroups.m_groupOu LIKE ?2 AND T_CmsDAOGroups.m_groupFlags >= ?3 
ORDER BY T_CmsDAOGroups.m_groupOu, T_CmsDAOGroups.m_groupName] --> 
[SELECT t1.group_id, t0.group_id, t0.user_id, t1.group_ou, t1.group_name 
FROM public.cms_groupusers t0, public.cms_groups t1 WHERE (t0.user_id = 
? AND t1.group_id = t0.group_id AND t1.group_ou LIKE ? ESCAPE '\\' AND 
t1.group_flags >= ?) ORDER BY t1.group_ou ASC, t1.group_name ASC]".


I checked and query parameters type match.

It is the java code :

Query q = .. ;

q.setParameter(1, userId.toString()); // string
q.setParameter(2, ouFqnParam); // string
q.setParameter(3, I_CmsPrincipal.FLAG_GROUP_ROLE); // int

What is wrong ?

TIA

Best regards
Georgi


Re: OpenJPA 2.0 binary distribution

2010-08-19 Thread Georgi Naplatanov

Hi Rick.

thank you for the information.

Best regards
Georgi

Rick Curtis wrote:

My understanding is that openjpa-2.0.0.jar has just the OpenJPA code,
openjpa-all-2.0.0.jar has all dependencies.

Thanks,
Rick

On Thu, Aug 19, 2010 at 6:07 AM, Georgi Naplatanov  wrote:


Hello list.

In the binary distribution are two files :
- openjpa-2.0.0.jar
- openjpa-all-2.0.0.jar

What are difference between these two files.

Best regards
Georgi







OpenJPA 2.0 binary distribution

2010-08-19 Thread Georgi Naplatanov

Hello list.

In the binary distribution are two files :
- openjpa-2.0.0.jar
- openjpa-all-2.0.0.jar

What are difference between these two files.

Best regards
Georgi


Re: prepared statement pooling & MySQL

2009-06-22 Thread Georgi Naplatanov

Hi Michael

here is the log, look at the end of file
http://os.oles.biz/opencms/jpa-driver/tmp/jpa-trace.log.tar.gz

The application use traditional join syntax

value="JoinSyntax=traditional, SupportsUniqueConstraints=false"/>


Best regards
Georgi

Michael Dick wrote:

Hi Georgi,

It's hard to say anything definitive without seeing the prepared statements
that are being pooled. We generate slightly different SQL for different
databases, and depending on your app it might not lend itself well to
pooling with MySQL.

Could you enable openjpa SQL tracing to see which statements are being
generated? Just add the following property to persistence.xml  :

 
or



When you see the SQL it might explain why pooling doesn't seem to help..

-mike


On Mon, Jun 22, 2009 at 6:35 AM, Georgi Naplatanov  wrote:


Hello list

I use OpenJPA with Apache DBCP in Java SE environment.

My problem is the performance when prepared statement pooling is enabled in
DBCP -  it is the same as when statement pooling is disabled.

My question is - why prepared statement pooling does not increase
performance on MySQL ?

BTW I made the same test with PostgreSQL and performance is better when
prepared statement pooling is enabled.

I use MySQL 5.0.51a and OpenJPA 1.2.0

it is the database configuration in my persistence.xml file.





Best regards
Georgi







prepared statement pooling & MySQL

2009-06-22 Thread Georgi Naplatanov

Hello list

I use OpenJPA with Apache DBCP in Java SE environment.

My problem is the performance when prepared statement pooling is enabled 
in DBCP -  it is the same as when statement pooling is disabled.


My question is - why prepared statement pooling does not increase 
performance on MySQL ?


BTW I made the same test with PostgreSQL and performance is better when 
prepared statement pooling is enabled.


I use MySQL 5.0.51a and OpenJPA 1.2.0

it is the database configuration in my persistence.xml file.

value="driverClassName=com.mysql.jdbc.Driver, 
url=jdbc:mysql://localhost:3306/cms8?characterEncoding=UTF-8, 
   username=xxx,

password=xxx,
maxActive=100,
maxIdle=100,
initialSize=100,
poolPreparedStatements=true"/>

value="org.apache.commons.dbcp.BasicDataSource"/>


Best regards
Georgi


Re: Uncommited objects and Select performance

2009-05-17 Thread Georgi Naplatanov
Hello, Jan

may be EntityManager.flush() method will improve performance lets say on
100 inserts.

Best regards
Georgi

Jan Kotek wrote:
> Hi,
> I have performance problem with queries on uncommited data.
>
> I run huge import, with commit at each 1 items. During import I
> make lot of selection queries (to protect data integrity), but they
> are very slow. With commit every 100 items, queries run lot of faster.
>
> Profiler told me that most of time is spend in dataobjects and
> enhancer methods (get double etc). I think OpenJPA is making linear
> scan on all uncommited items.
>
> I played with IgnoreChanges settings, but it does not seems to help.
> So my question is: can I speed up those selection queries?
>
> Thanks,
> Jan
>   



Re: Database support

2009-05-16 Thread Georgi Naplatanov
BTW HSQLDB supports memory based tables too. Is there a parameter in the
dictionary for switching between memory and disk based (cached) tables ?

Best regards
Georgi

Fay Wang wrote:
> Hi Kevin,
>
> What about SolidDB? The memory-based relational database?
>
> --- On Fri, 5/15/09, Kevin Sutter  wrote:
>
>   
>> From: Kevin Sutter 
>> Subject: Re: Database support
>> To: users@openjpa.apache.org
>> Date: Friday, May 15, 2009, 2:09 PM
>> Okay, so I'm looking at our stated
>> database support [1].� From this chart, I
>> would divide up the databases into the following
>> categories.� The "Not
>> Currently Covered" category is where I would focus my
>> phishing efforts
>> first.� Any discussion?
>>
>> Covered Interest by members of OpenJPA Community
>> ===
>> o� Derby
>> o� DB2
>> o� Informix
>> o� Oracle
>> o� MS SQL Server ???
>> o� Sybase ???
>>
>>
>> Not Currently Covered Interest by members of OpenJPA
>> Community
>> =
>> o� MySQL
>> o� PostgreSQL
>> o� H2
>> o� HSQLDB (Hypersonic)
>> o� Firebird ???
>>
>>
>> Are these still required?
>> =
>> o� Borland Interbase
>> o� Borland JDataStore
>> o� Empress
>> o� Intersystems Cache
>> o� MS Access
>> o� MS Visual FoxPro
>> o� Pointbase
>>
>> Thanks,
>> Kevin
>>
>> [1]
>> http://openjpa.apache.org/builds/latest/docs/manual/manual.html#dbsupport
>>
>> On Thu, May 14, 2009 at 10:01 AM, David Beer 
>> wrote:
>>
>> 
>>> Hi Kevin
>>>
>>> Some database vendors usually have some sort of
>>>   
>> universal contact which
>> 
>>> might be the best way of going about it. Posting a one
>>>   
>> of message to
>> 
>>> support forums might well be an idea that could work.
>>>
>>> David
>>>
>>> On Thu, 14 May 2009 08:46:03 -0500 Kevin Sutter
>>> 
>>>   
>> wrote:
>> 
 Hi David,

 On Wed, May 13, 2009 at 5:10 PM, David Beer
 wrote:

 
> Hi Kevin
>
> I currently use OpenJPA with the H2 database
>   
>> for my embeded
>> 
> programs, and will be considering MySQL for
>   
>> larger scale programs.
>> 
> I think that the more database vendors or
>   
>> suppliers we can get
>> 
> links with the better for both sides. I am
>   
>> happily using H2 with
>> 
> OpenJPA but there were some features I had
>   
>> to ask about and how to
>> 
> work with OenJPA.
>
> So my point is that we need a way of getting
>   
>> committers or users
>> 
> from both sides to help so we need a way of
>   
>> maybe certifying a
>> 
> database version.
>   
 It sounds like we're on the same page.� The
 
>> tricky part is signing up
>> 
 this help and support from these database vendors
 
>> and users groups.
>> 
 Maybe I should just post to these vendor's user
 
>> forums and ask for
>> 
 some support. Just go phishing...� :-)

 Kevin


 
> Jut my thoughts.
>
> David
>
> On Wed, 13 May 2009 16:36:53 -0500 Kevin
>   
>> Sutter
>> 
> 
>   
>> wrote:
>> 
>> Hi,
>> I'm trolling...� I'm looking for
>> 
>> ideas on how we can better
>> 
>> integrate with the various database
>> 
>> vendors.� Many of us
>> 
>> committers have our own "favorite"
>> 
>> databases due to our
>> 
>> employers' needs.� But, what about
>> 
>> the MySQL, or Postgres, or SQL
>> 
>> Server, or pick your favorite
>> 
>> databases?� I know we have had some
>> 
>> interest from these database vendors on
>> 
>> our users and dev forums,
>> 
>> but I'm looking for ways to get these
>> 
>> vendors more involved.
>> 
>> When they produce a new version of
>> 
>> their database, it would be
>> 
>> great to announce OpenJPA
>> 
>> support.� And, if they have new
>> 
>> features to take advantage of, that
>> 
>> would be even better.
>> 
>> Everybody's development and tests teams
>> 
>> are limited.� I understand
>> 
>> that. But, I'm looking for ideas on how
>> 
>> we can work together to
>> 
>> accomplish this task.� I'm going
>> 
>> to cross post on both users and
>> 
>> dev forums to see if there any lurkers
>> 
>> that might have some ideas.
>> 
>> Just to provide a real world
>> 
>> example...� I was just pinged about
>> 
>> MS SQL Server 2008 support.� Our
>> 
>> OpenJPA manual only documents SQL
>> 
>> Server 2005 support.� I don't have
>> 
>> experience with SQL Ser

Re: Optimistic locking errors were detected when flushing to the data store

2009-04-17 Thread Georgi Naplatanov
Hello Fay,

thank you for your response, but I can not reproduce this issue with
tracing switched on.

May be it is something related to
http://issues.apache.org/jira/browse/OPENJPA-921. I run junit test suits
and on every test suit running, the test creates a new instance of
EntityManagerFactiry.

Best regards
Georgi

Fay Wang wrote:
> Can you turn on the trace :
> 
> 
> 
> and attach the trace file for further investigation?
> 
> -Fay
> 
> --- On Thu, 4/16/09, Georgi Naplatanov  wrote:
> 
>> From: Georgi Naplatanov 
>> Subject: Optimistic locking errors were detected when flushing to the data 
>> store
>> To: users@openjpa.apache.org
>> Date: Thursday, April 16, 2009, 12:36 PM
>> Hello list.
>>
>> I upgraded OpenJPA from 1.2.0 to 1.2.1 and have the
>> following exception.
>> My environment is MySql 5.0.51 (MyISAM storage manager) and
>> JRE Sun
>> 1.6.0_13-b03. The application works without this exception
>> with OpenJPA
>> 1.2.0.
>>
>> Optimistic locking errors were detected when flushing to
>> the data store.
>>  The following objects may have been concurrently modified
>> in another
>> transaction:
>> [org.opencms.db.jpa.persistence.CmsDAOOfflineResources-3e51ea18-2abb-11de-93fb-4b60ca370499]
>> 
>> org.apache.openjpa.persistence.RollbackException:
>> Optimistic locking
>> errors were detected when flushing to the data store. 
>> The following
>> objects may have been concurrently modified in another
>> transaction:
>> [org.opencms.db.jpa.persistence.CmsDAOOfflineResources-3e51ea18-2abb-11de-93fb-4b60ca370499]
>> at
>> org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:523)
>> at
>> org.opencms.db.jpa.CmsDbContext.commitAndClose(CmsDbContext.java:129)
>> at
>> org.opencms.db.jpa.CmsDbContext.clear(CmsDbContext.java:73)
>> at
>> org.opencms.db.CmsSecurityManager.publishProject(CmsSecurityManager.java:3107)
>> at
>> org.opencms.publish.CmsPublishManager.publishProject(CmsPublishManager.java:501)
>> at
>> org.opencms.publish.CmsPublishManager.publishProject(CmsPublishManager.java:525)
>> at
>> org.opencms.publish.CmsPublishManager.publishResource(CmsPublishManager.java:563)
>> at
>> org.opencms.file.TestPublishIssues.testPublishFolderWithDeletedFileFromOtherProject(TestPublishIssues.java:335)
>> at
>> junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
>> at
>> junit.extensions.TestSetup$1.protect(TestSetup.java:19)
>> at
>> junit.extensions.TestSetup.run(TestSetup.java:23)
>> Caused by: > error>
>> org.apache.openjpa.persistence.OptimisticLockException:
>> Optimistic
>> locking errors were detected when flushing to the data
>> store.  The
>> following objects may have been concurrently modified in
>> another
>> transaction:
>> [org.opencms.db.jpa.persistence.CmsDAOOfflineResources-3e51ea18-2abb-11de-93fb-4b60ca370499]
>> at
>> org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2160)
>> at
>> org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2010)
>> at
>> org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1908)
>> at
>> org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1826)
>> at
>> org.apache.openjpa.kernel.LocalManagedRuntime.commit(LocalManagedRuntime.java:81)
>> at
>> org.apache.openjpa.kernel.BrokerImpl.commit(BrokerImpl.java:1350)
>> at
>> org.apache.openjpa.kernel.DelegatingBroker.commit(DelegatingBroker.java:877)
>> at
>> org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:512)
>> Caused by: > error>
>> org.apache.openjpa.persistence.OptimisticLockException: An
>> optimistic
>> lock violation was detected when flushing object instance
>> "org.opencms.db.jpa.persistence.CmsDAOOfflineResources-3e51ea18-2abb-11de-93fb-4b60ca370499"
>> to the data store.  This indicates that the object was
>> concurrently
>> modified in another transaction.
>> FailedObject:
>> org.opencms.db.jpa.persistence.CmsDAOOfflineResources-3e51ea18-2abb-11de-93fb-4b60ca370499
>> at
>> org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:124)
>> at
>> org.apache.openjpa.jdbc.kernel.BatchingPreparedStatementManagerImpl.flushAndUpdate(BatchingPreparedStatementManagerImpl.java:82)
>> at
>> org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(Pr

Optimistic locking errors were detected when flushing to the data store

2009-04-16 Thread Georgi Naplatanov
Hello list.

I upgraded OpenJPA from 1.2.0 to 1.2.1 and have the following exception.
My environment is MySql 5.0.51 (MyISAM storage manager) and JRE Sun
1.6.0_13-b03. The application works without this exception with OpenJPA
1.2.0.

Optimistic locking errors were detected when flushing to the data store.
 The following objects may have been concurrently modified in another
transaction:
[org.opencms.db.jpa.persistence.CmsDAOOfflineResources-3e51ea18-2abb-11de-93fb-4b60ca370499]

org.apache.openjpa.persistence.RollbackException: Optimistic locking
errors were detected when flushing to the data store.  The following
objects may have been concurrently modified in another transaction:
[org.opencms.db.jpa.persistence.CmsDAOOfflineResources-3e51ea18-2abb-11de-93fb-4b60ca370499]
at
org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:523)
at org.opencms.db.jpa.CmsDbContext.commitAndClose(CmsDbContext.java:129)
at org.opencms.db.jpa.CmsDbContext.clear(CmsDbContext.java:73)
at
org.opencms.db.CmsSecurityManager.publishProject(CmsSecurityManager.java:3107)
at
org.opencms.publish.CmsPublishManager.publishProject(CmsPublishManager.java:501)
at
org.opencms.publish.CmsPublishManager.publishProject(CmsPublishManager.java:525)
at
org.opencms.publish.CmsPublishManager.publishResource(CmsPublishManager.java:563)
at
org.opencms.file.TestPublishIssues.testPublishFolderWithDeletedFileFromOtherProject(TestPublishIssues.java:335)
at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
at junit.extensions.TestSetup.run(TestSetup.java:23)
Caused by: 
org.apache.openjpa.persistence.OptimisticLockException: Optimistic
locking errors were detected when flushing to the data store.  The
following objects may have been concurrently modified in another
transaction:
[org.opencms.db.jpa.persistence.CmsDAOOfflineResources-3e51ea18-2abb-11de-93fb-4b60ca370499]
at
org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2160)
at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2010)
at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1908)
at
org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1826)
at
org.apache.openjpa.kernel.LocalManagedRuntime.commit(LocalManagedRuntime.java:81)
at org.apache.openjpa.kernel.BrokerImpl.commit(BrokerImpl.java:1350)
at
org.apache.openjpa.kernel.DelegatingBroker.commit(DelegatingBroker.java:877)
at
org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:512)
Caused by: 
org.apache.openjpa.persistence.OptimisticLockException: An optimistic
lock violation was detected when flushing object instance
"org.opencms.db.jpa.persistence.CmsDAOOfflineResources-3e51ea18-2abb-11de-93fb-4b60ca370499"
to the data store.  This indicates that the object was concurrently
modified in another transaction.
FailedObject:
org.opencms.db.jpa.persistence.CmsDAOOfflineResources-3e51ea18-2abb-11de-93fb-4b60ca370499
at
org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:124)
at
org.apache.openjpa.jdbc.kernel.BatchingPreparedStatementManagerImpl.flushAndUpdate(BatchingPreparedStatementManagerImpl.java:82)
at
org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:89)
at
org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:72)
at
org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:543)
at
org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:106)
at
org.apache.openjpa.jdbc.kernel.BatchingConstraintUpdateManager.flush(BatchingConstraintUpdateManager.java:59)
at
org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:89)
at
org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:72)
at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:717)
at
org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:130)
at
org.apache.openjpa.datacache.DataCacheStoreManager.flush(DataCacheStoreManager.java:562)
at
org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:130)

Best regards
Georgi


Re: Questions about classpath for OpenJPA

2009-03-19 Thread Georgi Naplatanov
Hello Paul.

You may consider to add commons-dbcp and commons-pool jars for
connection pooling. You may use commons-pool for pooling EntityManager
instances.

Best regards
Georgi

Paul Copeland wrote:
> I am just getting started and created a simple standalone (not in an app
> server container) JPA application working with both TopLink and OpenJPA
> 1.2 and tested with both MySQL and Postgres.  This is with Java SE
> 1.5.0_05 building with Ant (not in in an IDE).
> 
> By trial and error I found I needed the jar files downloaded in the
> apache-openjpa-1.2.0 lib directory. I also needed xercesImpl.jar.  I did
> not find these dependencies documented in the release notes, or in the
> manual, or on the Quickstart page 
> (http://openjpa.apache.org/quick-start.html).
> 
> These were the necessary jars at either compile time or runtime -
> 
> commons-collections-3.2.jar
> commons-lang-2.1.jar
> geronimo-jpa_3.0_spec-1.0.jar
> geronimo-jta_1.1_spec-1.1.jar
> openjpa-1.2.0.jar
> serp-1.13.1.jar
> xercesImpl.jar
> 
> Probably I will also need commons-pool-1.3.jar or something similar for
> Connection pooling.
> 
> Presumably the geronimo jars are not needed in a Java 5 EE container. 
> I'm not sure why xerces is required since Java SE 1.5 has a SAX parser. 
> I guess all the other jars need to be deployed in the classpath in most
> other contexts.
> 
> This kind of dependency information might be usefully documented
> somewhere.  Every new user has to figure this stuff out.
> 
> BTW - My target runtime environment will be Tomcat 6 + Java SE 1.6 +
> OpenJPA 1.2 + Postgres 8.2.x
> 
> Any experience or advice about what jars are required or is this already
> documented somewhere?
> 
> Thanks - Paul
> 
> 



Re: Slow performance with OpenJPA when selecting from a ManyToMany relation.

2009-03-18 Thread Georgi Naplatanov
Hello Shubbis.

Did you check generated SQL ?

OpenJPA has property about how to perform joins.

My be with traditional join syntax performance will be better.

 

Best regards
Georgi

Shubbis wrote:
> Todays update, for those who are interested. ;)
> 
> I've uninstalled all JRE, JDK, SDK etc all java dirs have been deleted and
> I've reinstalled everything (related to java) and downloaded Eclipse
> Ganymede, I installed the latest nightly build of OpenJPA and made a fresh
> new project, I even copied the project from home and imported it, still no
> luck with the resulting time.
> 
> Now, here's the kicker. I exported to a runnable jar file and ran it on a
> Debian linux server, the same one that runs our MySQL server, and it took 5~
> sec. to complete 500 iterations. So half the time, but still not close to
> good enough..
> 
> I just don't get it!
> 
> Anything..?
> 
> Shubbis
> 
> 
> Paul Copeland wrote:
>> What is different abut your laptop at home vs. multiple computers at 
>> work?  Are they all connected to the same network?
>>
>> On 3/17/2009 11:30 AM, Shubbis wrote:
>>> Ok, I still dont know what the problem is, but it seems like its not
>>> OpenJPA's fault (i think).
>>> I just took the whole project home with me, and installed it on my own
>>> laptop in a new workspace, and what do you know.. It took 2.3 sec.
>>> compared
>>> to the 12-15 sec.
>>>
>>> Now, I still don't know the root of the cause, since we have tried it on
>>> multiple computers at work, but at least this confirms that the project
>>> itself is working.
>>>
>>> Btw Pinaki, your plugin works perfect with MyEclipse 7.1.1 aswell. FYI.
>>> Nice
>>> work ;)
>>>
>>> Shubbis
>>>
>>> PS: adding the project if anyone wants to see. This is without all Ant
>>> and
>>> OpenJPA jar files as they were to big to upload here.
>>>
>>> http://n2.nabble.com/file/n2493009/OpenJPASISTETEST.rar
>>> OpenJPASISTETEST.rar 
>>>
>>>
>>> Pinaki Poddar wrote:
>>>   
 Hi,
 
> Maybe someone could post an example of their build.xml file so that i
> could try it. See if maybe its my 
> enhancing thats the problem.
>   
   If you are an Eclipse IDE user, you can try a plugin [1] that keeps
 your
 classes enhanced always. Or you may be better of with Ant builds as Mike
 had provided. 

   In either case, Enhancer displays log messages and running it twice
 perhaps will confirm -- because second time it will say: 'class X is
 already persistence-capable. Ignoring...' etc.  

 [1] http://people.apache.org/~ppoddar/eclipse/


 
>>>
>>>
>>>   
>>
>>
> 



EhCache size

2009-03-16 Thread Georgi Naplatanov
Hello, Craig.

OPENJPA-980 is a good job, but how I can configure query's data cache size ?

Best regards
Georgi


Re: JPA 2.0 development plans...

2008-10-31 Thread Georgi Naplatanov
Hello, list.

As i can see there are not addressed constraint names. It will be nice
developer to set name for constraints and indexes for better maintenance
in the future. In this way OpenJPA schema generator will be more useful.

Best regards
Georgi

Jeremy Bauer wrote:
> Hi Adam,
> 
> There is no list that I know of, yet. OpenJPA trunk is primed for 2.0
> development and 2.0 planning will begin shortly, including a call for
> participation.  I agree, part of the planning process needs to include
> mapping existing OpenJPA functionality to the corresponding function
> in JPA 2.0.  There is a public draft of JSR-317 available for review
> at http://jcp.org/aboutJava/communityprocess/edr/jsr317/.  If you (and
> others) would like to contribute to this effort, that would be
> fantastic.  I've opened a JIRA task
> https://issues.apache.org/jira/browse/OPENJPA-757 for this piece of
> work, for now.  As JPA 2.0 development gets underway lets take
> advantage of the wiki and other tools to better manage, document, and
> organize the effort.
> 
> -Jeremy
> 
> On Fri, Oct 31, 2008 at 4:57 AM, Adam Hardy <[EMAIL PROTECTED]> wrote:
>> Is there a list of new JPA 2.0 spec features which are already covered by
>> existing OpenJPA features?
>>
>> Such as @Dependent or @OrderColumn ?
>>
>>
>>
>> On Sep 30, 2008, at 9:10 AM, Kevin Sutter wrote:
>>> Due to the upcoming JPA 2.0 development activities, the OpenJPA svn
>>> repository needs to make a few changes.  Since the JPA 2.0 changes
>>> could be disruptive to current JPA 1.0 processing (at least during
>>> initial development), I would like to create a 1.3.x service branch.
>>> This 1.3.x branch would indicate the end of new development based on
>>> the JPA 1.0 specification.  This 1.3.x branch could be used for any
>>> necessary support activities (or even a potential release, if
>>> necessary), but the mainline trunk would now become the basis for JPA
>>> 2.0 development (2.0.0-SNAPSHOT).
>>>
>>> All new development activity would continue in trunk, just like the
>>> past. But, we would also have the ability to start experimenting with
>>> some of the new features that have been identified in the early
>>> drafts of the JPA 2.0 specification.  Granted, we only have the
>>> single Early Draft Review version of the JPA 2.0 spec, but it's at
>>> least a start.  Even if we have to modify a few things along the way,
>>> at least we're getting experience with the new specification.  And,
>>> we can initiate a roadmap for the new features and hopefully
>>> encourage new participation by the diverse OpenJPA community.
>>>
>>> We need to determine the "best date" for this cutover.  Since I'm not
>>>  sure on the current development activities of the OpenJPA developers,
>>> let's use this thread for the discussion.  Since the end of Sept is fast
>>> approaching, let's shoot for Friday, Oct 31 as the cutover date.
>>>
>>> Comments or suggestions are welcome!
>>



Re: Cache Problem

2008-09-16 Thread Georgi Naplatanov
Hello, egoosen.

Do you can prepare a test case which reproduce this problem ?

In case you can do this, please open an issue report on Jira.

I had similar problem, but can not localize the problem and create a
test case.

Best regards
Georgi

egoosen wrote:
> I'm experiencing a cache problem with the current version of OpenJPA (1.2.0),
> and previous versions.
> I've setup the cache as follows in persistence.xml:
>value="true(CacheSize=25000, 
> SoftReferenceSize=0)" />
>value="CacheSize=5000, SoftReferenceSize=100" />
> 
> 
> We're using Spring JpaDaoSupport.
> The org.springframework.orm.jpa.LocalEntityManagerFactoryBean is Spring
> loaded.
> 
> The problem is that my query is returning stale data after an update/insert.
> The update/insert is happening in a separate transaction from the select.
> 
> I've tried calling em.refresh(entity), but that didn't work.
> 
> Any ideas how I can fix this besides turning cacheing off completely?



Re: about OpenJPA logo

2008-08-29 Thread Georgi Naplatanov
Hello, Ignacio .

My be we should announce a competition for OpenJPA logo :)

I know  somebody who may prepare one, but it will be nice if there are
some requirements defined. For example i like Apache's feather.

Best regards
Georgi

Ignacio Andreu wrote:
> As far as I know OpenJPA desn't have a logo, would be great to have one ...
> any volunteer?
> 
> On Fri, Aug 29, 2008 at 12:02 PM, Georgi Naplatanov <[EMAIL PROTECTED]> wrote:
> 
>> Hello, list.
>>
>> Does OpenJPA have a logo in jpg, png or gif format ?
>>
>> Best regards
>> Georgi
>>
> 



about OpenJPA logo

2008-08-29 Thread Georgi Naplatanov
Hello, list.

Does OpenJPA have a logo in jpg, png or gif format ?

Best regards
Georgi


Re: slow performance on MySql 5.0

2008-08-27 Thread Georgi Naplatanov
Hello, Milosz.

> Have you compared the actual SQL statements being issued by PostgreSQL
and MySQL versions?

I switched to traditional join syntax and performance is better.



SQL statements  are very similar compared to SQL and JPA implementations
excepts number of fields which are selected and some brackets in the
where clause.

In the MySql logs are a lot of

SET autocommit=1
SET autocommit=0

and i still not finding a way to remove them.

> You could also experiment with useServerPrepStmts property.

I did it, but it is slower.
It is the used JDBC URL -

jdbc:mysql://localhost/ocmsjpa?cachePrepStmts=true&cacheCallableStatements=true&cacheServerConfiguration=true&useLocalSessionState=true&elideSetAutoCommits=true&alwaysSendSetIsolation=false&enableQueryTimeouts=false&prepStmtCacheSize=3000&prepStmtCacheSqlLimit=1000

I have to find a way to remove "SET autocommit" calls and to tune fetch
modes and fetch groups before compare performance between SQL and JPA
implementations again.

Best regards
Georgi


Miłosz Tylenda wrote:
> Georgi,
> 
> Have you compared the actual SQL statements being issued by PostgreSQL and 
> MySQL versions? If I remember correctly, setting the 
> autoGenerateTestcaseScript=true Connector/J property will show you all the 
> statements including the implicit ones coming from the driver/transaction 
> manager. I once was quite surprised how many additional statements were 
> issued by some EJB 2 implementation - commit/rollback, playing with 
> autocommit and transaction isolation. Maybe this accounts for the difference.
> 
> You could also experiment with useServerPrepStmts property.
> 
> Regards,
> Milosz
> 
> 
> 
>> Hello, Kevin.
>>
>>> Did you also happen to try the QuerySQLCache option?
>> Yes, but this application use something like logical table partitioning
>> and retrieves data by queries (depends on application logic, it switch
>> from one to another table and it has good SQL/JPQL factory for this
>> purpose).
>>
>>> What is your goal or target?
>> I think that 10-15% performance loss is excellent result at this time.
>>
>> To be honest, on PostgreSQL the performance loss is less than 10%.
>> I guess that bigger performance loss on MySql is something related to
>> prepared statements or retrieving binary data, but it's only my guess.
>>
>>> Another area that may be different with any JPA implementation is the
>> use of
>>> EAGER vs LAZY fetch modes.
>> I will think about this and future improvements.
>>
>> Thank you again.
>>
>> Best regards
>> Georgi
>>
>> Kevin Sutter wrote:
>>> Excellent!
>>>
>>> Did you also happen to try the QuerySQLCache option?
>>>
>>> What is your goal or target?  Granted, straight JDBC will most likely be
>>> better performing in most cases.  But, it does depend on your application's
>>> goals.
>>>
>>> Another area that may be different with any JPA implementation is the use of
>>> EAGER vs LAZY fetch modes.  You need to ensure that the proper configuration
>>> is set up for the application usage.  You don't want to be constantly
>>> retrieving extra data via the EAGER mode, if that data is never or rarely
>>> referenced.  In the same light, if you are constantly accessing related data
>>> that is set to LAZY mode, then you are causing extra trips to the database,
>>> which affects performance.
>>>
>>> Good luck,
>>> Kevin
>>>
>>> On Tue, Aug 26, 2008 at 8:41 AM, Georgi Naplatanov  wrote:
>>>
>>>> Hello, Kevin.
>>>>
>>>> The implementation with pooling of EntityManager instances is much
>>>> faster. With this implementation performance loss on PostgreSQL is less
>>>>  than 10%, on MySql between 12-22% for web application which i test.
>>>>
>>>> Best regards
>>>> Georgi
>>>>
>>>> Georgi Naplatanov wrote:
>>>>> Hello, Kevin, thank you for ideas.
>>>>>
>>>>> I didn't think to pool EntityManager instances. I definitely  will try
>>>> it.
>>>>> Best regards
>>>>> Georgi
>>>>>
>>>>> Kevin Sutter wrote:
>>>>>> Georgi,
>>>>>> One of the first areas I would look at is the creation and destruction
>>>> of
>>>>>> the EntityManagers.  You mention that you are running with an extended
>>>>>> context, but does the application create or pool EntityManagers?
>>>>  Al

Re: slow performance on MySql 5.0

2008-08-26 Thread Georgi Naplatanov
Hello, Kevin.

> Did you also happen to try the QuerySQLCache option?

Yes, but this application use something like logical table partitioning
and retrieves data by queries (depends on application logic, it switch
from one to another table and it has good SQL/JPQL factory for this
purpose).

> What is your goal or target?

I think that 10-15% performance loss is excellent result at this time.

To be honest, on PostgreSQL the performance loss is less than 10%.
I guess that bigger performance loss on MySql is something related to
prepared statements or retrieving binary data, but it's only my guess.

> Another area that may be different with any JPA implementation is the
use of
> EAGER vs LAZY fetch modes.

I will think about this and future improvements.

Thank you again.

Best regards
Georgi

Kevin Sutter wrote:
> Excellent!
> 
> Did you also happen to try the QuerySQLCache option?
> 
> What is your goal or target?  Granted, straight JDBC will most likely be
> better performing in most cases.  But, it does depend on your application's
> goals.
> 
> Another area that may be different with any JPA implementation is the use of
> EAGER vs LAZY fetch modes.  You need to ensure that the proper configuration
> is set up for the application usage.  You don't want to be constantly
> retrieving extra data via the EAGER mode, if that data is never or rarely
> referenced.  In the same light, if you are constantly accessing related data
> that is set to LAZY mode, then you are causing extra trips to the database,
> which affects performance.
> 
> Good luck,
> Kevin
> 
> On Tue, Aug 26, 2008 at 8:41 AM, Georgi Naplatanov <[EMAIL PROTECTED]> wrote:
> 
>> Hello, Kevin.
>>
>> The implementation with pooling of EntityManager instances is much
>> faster. With this implementation performance loss on PostgreSQL is less
>>  than 10%, on MySql between 12-22% for web application which i test.
>>
>> Best regards
>> Georgi
>>
>> Georgi Naplatanov wrote:
>>> Hello, Kevin, thank you for ideas.
>>>
>>> I didn't think to pool EntityManager instances. I definitely  will try
>> it.
>>> Best regards
>>> Georgi
>>>
>>> Kevin Sutter wrote:
>>>> Georgi,
>>>> One of the first areas I would look at is the creation and destruction
>> of
>>>> the EntityManagers.  You mention that you are running with an extended
>>>> context, but does the application create or pool EntityManagers?
>>  Although
>>>> our testing has been with IBM databases, we have found that we get the
>> best
>>>> performance with the minimum number of EntityManager creations.  If you
>> can
>>>> clear and reuse the EntityManagers, the overall performance will be
>> better.
>>>> There is another cache that helps with sql generation as well.  It has a
>>>> couple of restrictions, but if the majority of your queries are simple
>>>> findby operations, this cache will help considerably.  The property is
>>>> QuerySQLCache and it is documented in the OpenJPA 1.2.x manual (
>>>>
>> http://openjpa.apache.org/builds/1.2.0/apache-openjpa-1.2.0/docs/manual/manual.html#ref_guide_cache_querysql
>>>> ).
>>>>
>>>> Hope this helps with getting better performance.
>>>>
>>>> Kevin
>>>>
>>>> On Mon, Aug 25, 2008 at 3:21 PM, Georgi Naplatanov <[EMAIL PROTECTED]>
>> wrote:
>>>>> Hello,
>>>>>
>>>>> I'm porting SQL/JDBC web application to JPA and i made some performance
>>>>> tests with PostgreSQL 8.3.3 and MySql 5.0.51a Community edition, with
>>>>> both - SQL/JDBC and OpenJPA implementations of the application.
>>>>>
>>>>>Apache ab   Apache Jmeter
>>>>> PostgreSQL 8.3   -15%   -12%
>>>>> MySql 5.0.51a-64%   -27%
>>>>>
>>>>> On both tests on PostgreSQL the performance loss is about 15% compared
>>>>> to pure SQL/JDBC implementation.
>>>>>
>>>>> On MySql the performance loss is very big especially on test with
>> Apache
>>>>> ab utility.
>>>>>
>>>>> In the tests, OpenJPA 1.2.0 is configured with data cache enabled,
>> query
>>>>> data cache disabled and query compilation cache - enabled. OpenJPA
>>>>> operates in extended context with Apache DBCP and statement pooling.
>>>>>
>>>>> Is

Re: slow performance on MySql 5.0

2008-08-26 Thread Georgi Naplatanov
Hello, Kevin.

The implementation with pooling of EntityManager instances is much
faster. With this implementation performance loss on PostgreSQL is less
 than 10%, on MySql between 12-22% for web application which i test.

Best regards
Georgi

Georgi Naplatanov wrote:
> Hello, Kevin, thank you for ideas.
> 
> I didn't think to pool EntityManager instances. I definitely  will try it.
> 
> Best regards
> Georgi
> 
> Kevin Sutter wrote:
>> Georgi,
>> One of the first areas I would look at is the creation and destruction of
>> the EntityManagers.  You mention that you are running with an extended
>> context, but does the application create or pool EntityManagers?  Although
>> our testing has been with IBM databases, we have found that we get the best
>> performance with the minimum number of EntityManager creations.  If you can
>> clear and reuse the EntityManagers, the overall performance will be better.
>>
>> There is another cache that helps with sql generation as well.  It has a
>> couple of restrictions, but if the majority of your queries are simple
>> findby operations, this cache will help considerably.  The property is
>> QuerySQLCache and it is documented in the OpenJPA 1.2.x manual (
>> http://openjpa.apache.org/builds/1.2.0/apache-openjpa-1.2.0/docs/manual/manual.html#ref_guide_cache_querysql
>> ).
>>
>> Hope this helps with getting better performance.
>>
>> Kevin
>>
>> On Mon, Aug 25, 2008 at 3:21 PM, Georgi Naplatanov <[EMAIL PROTECTED]> wrote:
>>
>>> Hello,
>>>
>>> I'm porting SQL/JDBC web application to JPA and i made some performance
>>> tests with PostgreSQL 8.3.3 and MySql 5.0.51a Community edition, with
>>> both - SQL/JDBC and OpenJPA implementations of the application.
>>>
>>>Apache ab   Apache Jmeter
>>> PostgreSQL 8.3   -15%   -12%
>>> MySql 5.0.51a-64%   -27%
>>>
>>> On both tests on PostgreSQL the performance loss is about 15% compared
>>> to pure SQL/JDBC implementation.
>>>
>>> On MySql the performance loss is very big especially on test with Apache
>>> ab utility.
>>>
>>> In the tests, OpenJPA 1.2.0 is configured with data cache enabled, query
>>> data cache disabled and query compilation cache - enabled. OpenJPA
>>> operates in extended context with Apache DBCP and statement pooling.
>>>
>>> Is this performance loss on MySql normal ? Does OpenJPA require some
>>> special configuration for MySql ?
>>>
>>> It is my persistence.xml file.
>>>
>>> >> value="DriverClassName=com.mysql.jdbc.Driver,
>>> Url=jdbc:mysql://localhost/mydb,
>>> Username=root,
>>> Password=123,
>>> maxActive=25,
>>> maxWait=25,
>>> minIdle=3,
>>> maxIdle=25,
>>> whenExhaustedAction=block,
>>> testOnBorrow=false,
>>> testWhileIdle=true,
>>> timeBetweenEvictionRunsMillis=360,
>>> numTestsPerEvictionRun=3,
>>> minEvictableIdleTime=180,
>>> testQuery=select 1,
>>> poolPreparedStatements=true"/>
>>>  >> value="org.apache.commons.dbcp.BasicDataSource"/>
>>>
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> >>
>>> value="org.apache.openjpa.jdbc.sql.MySQLDictionary(SupportsSubselect=true)"/>
>>>
>>> Best regards
>>> Georgi
>>>
> 
> 



Re: sql ordering

2008-08-25 Thread Georgi Naplatanov
Hello, Pinaki.

> Nope. Unique constraints can be placed by annotations/xml descriptors. But
> the topological sorting algorithm that imposes an order on sql
statements to
> satisfy both database constraints and object-level operations do not
> consider unique constraints.

You are right, but i think that OperationOrderUpdateManager satisfy most
of possible scenarios to not violate particular unique constraint.

Scenario 1
update old (1-> x)
insert new (1)

Scenario 2
delete old (1)
insert new (1)

Scenario 3
update old (1 -> x)
update old (y -> 1)

In case i understand the logic of

OperationOrderUpdateManager.flush(RowManager rowMgr,
PreparedStatementManager psMgr, Collection exceps)

method correctly, it executes :
 1. delete statements
 2. updated rows with changed primary or foreign key
 3. rest of operations which are in the order of application logic.

The only possible scenario to violate unique constraint is Scenario 3,
when second row changes its foreign key and its update be executed first.

BTW: Why there are so complex implementations of UpdateManager rather
single, simple ApplicationOrderUpdateManager ?

Best regards
Georgi

Pinaki Poddar wrote:
> Hi,
>> That's great news; I did not think unique constraints had been fixed. 
> 
> Nope. Unique constraints can be placed by annotations/xml descriptors. But
> the topological sorting algorithm that imposes an order on sql statements to
> satisfy both database constraints and object-level operations do not
> consider unique constraints. 
> 
> So if a transaction removes x1 and inserts x2 while x1 and x2 has the same
> value for a unique non-primary column then OpenJPA *does not* ensure that
> DELETE x1 will be issued before INSERT x2.  
> 


Re: slow performance on MySql 5.0

2008-08-25 Thread Georgi Naplatanov
Hello, Kevin, thank you for ideas.

I didn't think to pool EntityManager instances. I definitely  will try it.

Best regards
Georgi

Kevin Sutter wrote:
> Georgi,
> One of the first areas I would look at is the creation and destruction of
> the EntityManagers.  You mention that you are running with an extended
> context, but does the application create or pool EntityManagers?  Although
> our testing has been with IBM databases, we have found that we get the best
> performance with the minimum number of EntityManager creations.  If you can
> clear and reuse the EntityManagers, the overall performance will be better.
> 
> There is another cache that helps with sql generation as well.  It has a
> couple of restrictions, but if the majority of your queries are simple
> findby operations, this cache will help considerably.  The property is
> QuerySQLCache and it is documented in the OpenJPA 1.2.x manual (
> http://openjpa.apache.org/builds/1.2.0/apache-openjpa-1.2.0/docs/manual/manual.html#ref_guide_cache_querysql
> ).
> 
> Hope this helps with getting better performance.
> 
> Kevin
> 
> On Mon, Aug 25, 2008 at 3:21 PM, Georgi Naplatanov <[EMAIL PROTECTED]> wrote:
> 
>> Hello,
>>
>> I'm porting SQL/JDBC web application to JPA and i made some performance
>> tests with PostgreSQL 8.3.3 and MySql 5.0.51a Community edition, with
>> both - SQL/JDBC and OpenJPA implementations of the application.
>>
>>Apache ab   Apache Jmeter
>> PostgreSQL 8.3   -15%   -12%
>> MySql 5.0.51a-64%   -27%
>>
>> On both tests on PostgreSQL the performance loss is about 15% compared
>> to pure SQL/JDBC implementation.
>>
>> On MySql the performance loss is very big especially on test with Apache
>> ab utility.
>>
>> In the tests, OpenJPA 1.2.0 is configured with data cache enabled, query
>> data cache disabled and query compilation cache - enabled. OpenJPA
>> operates in extended context with Apache DBCP and statement pooling.
>>
>> Is this performance loss on MySql normal ? Does OpenJPA require some
>> special configuration for MySql ?
>>
>> It is my persistence.xml file.
>>
>> > value="DriverClassName=com.mysql.jdbc.Driver,
>> Url=jdbc:mysql://localhost/mydb,
>> Username=root,
>> Password=123,
>> maxActive=25,
>> maxWait=25,
>> minIdle=3,
>> maxIdle=25,
>> whenExhaustedAction=block,
>> testOnBorrow=false,
>> testWhileIdle=true,
>> timeBetweenEvictionRunsMillis=360,
>> numTestsPerEvictionRun=3,
>> minEvictableIdleTime=180,
>> testQuery=select 1,
>> poolPreparedStatements=true"/>
>>  > value="org.apache.commons.dbcp.BasicDataSource"/>
>>
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> >
>> value="org.apache.openjpa.jdbc.sql.MySQLDictionary(SupportsSubselect=true)"/>
>>
>> Best regards
>> Georgi
>>
> 



Re: sql ordering

2008-08-25 Thread Georgi Naplatanov
Hello, Reece, you are happy man. This problem seems solved. I tested it
with OpenJPA 1.2.0.

You have to declare you unique constraint in the persistence class(es)
something like:

@Entity
@Table(name="my_table_name",
[EMAIL PROTECTED](columnNames={"my_field1_id",
"my_field2_id"}))
public class MyClass {
.
.

and to add following property to pesistence.xml file



Best regards
Georgi

Reece Garrett wrote:
> Georgi,
> 
> Perhaps I misunderstood your original post. My problem was related to the 
> ordering of insert/delete/and update statements. For example, if in the same 
> transaction I delete a row with a unique column value A and also insert a row 
> with unique column value A OpenJPA will sometimes do the insert before the 
> delete and violate the unique constraint. And since I'm forced to use a DBMS 
> that does not support differed constraints I need OpenJPA to order statements 
> such that unique constraints aren't violated.
> 
> It sounds like your problem is considerably different than mine.
> 
> -Reece
> 
>>>> Georgi Naplatanov <[EMAIL PROTECTED]> 8/25/2008 12:31 PM >>>
> Hello, Reece.
> 
> I switched on OpenJPA logging and in some situations OpenJPA try to
> insert 2 rows with the same values of constraint's fields which violates
> unique constraint.
> It occurs only  when query's data cache is enabled (it is enabled by
> default).
> 
> Is your problem stopping raise when you switch off query data cache ?
> 
> At this time i can not isolate the problem and i can not prepare a test
> case which will reproduce this problem. It is the reason to not open an
> issue report.
> 
> Reece Garrett wrote:
>> Hello,
>>
>> You may want to look at http://issues.apache.org/jira/browse/OPENJPA-235. I 
>> was having problems with OpenJPA violating foreign key constraints because 
>> of the order SQL statements ran. Later I found, as have you, that unique 
>> constraints are also violated. Foreign keys now seem to be working but 
>> unique constraints are still a problem. At one point I was conversing with 
>> Markus Fuchs about the problem but we both got busy and nothing got done. My 
>> JIRA was closed with instructions that other cases which need addressing 
>> should be placed in a separate JIRA. So you should open a new JIRA and link 
>> it to OPENJPA-235.
>>
>> -Reece 
>>
>>>>> Georgi Naplatanov <[EMAIL PROTECTED]> 8/24/2008 4:46:06 AM >>>
>> Hello, everybody.
>>
>> Is there a way to be executed generated SQL statements in order in which
>> application passes them to OpenJPA ?
>>
>> I tried "operation-order" implementation, but it reorders statements and
>> violates unique constraints in the database despite they are declared in
>> persistence classes, even query data cache is switched on.
>>
>> Best regards
>> Georgi
>>
>>
>>
>>
>>
> 
> 



slow performance on MySql 5.0

2008-08-25 Thread Georgi Naplatanov
Hello,

I'm porting SQL/JDBC web application to JPA and i made some performance
tests with PostgreSQL 8.3.3 and MySql 5.0.51a Community edition, with
both - SQL/JDBC and OpenJPA implementations of the application.

Apache ab   Apache Jmeter
PostgreSQL 8.3   -15%   -12%
MySql 5.0.51a-64%   -27%

On both tests on PostgreSQL the performance loss is about 15% compared
to pure SQL/JDBC implementation.

On MySql the performance loss is very big especially on test with Apache
ab utility.

In the tests, OpenJPA 1.2.0 is configured with data cache enabled, query
data cache disabled and query compilation cache - enabled. OpenJPA
operates in extended context with Apache DBCP and statement pooling.

Is this performance loss on MySql normal ? Does OpenJPA require some
special configuration for MySql ?

It is my persistence.xml file.


  










Best regards
Georgi


Re: sql ordering

2008-08-25 Thread Georgi Naplatanov
Hello, Reece.

I switched on OpenJPA logging and in some situations OpenJPA try to
insert 2 rows with the same values of constraint's fields which violates
unique constraint.
It occurs only  when query's data cache is enabled (it is enabled by
default).

Is your problem stopping raise when you switch off query data cache ?

At this time i can not isolate the problem and i can not prepare a test
case which will reproduce this problem. It is the reason to not open an
issue report.

Reece Garrett wrote:
> Hello,
> 
> You may want to look at http://issues.apache.org/jira/browse/OPENJPA-235. I 
> was having problems with OpenJPA violating foreign key constraints because of 
> the order SQL statements ran. Later I found, as have you, that unique 
> constraints are also violated. Foreign keys now seem to be working but unique 
> constraints are still a problem. At one point I was conversing with Markus 
> Fuchs about the problem but we both got busy and nothing got done. My JIRA 
> was closed with instructions that other cases which need addressing should be 
> placed in a separate JIRA. So you should open a new JIRA and link it to 
> OPENJPA-235.
> 
> -Reece 
> 
>>>> Georgi Naplatanov <[EMAIL PROTECTED]> 8/24/2008 4:46:06 AM >>>
> Hello, everybody.
> 
> Is there a way to be executed generated SQL statements in order in which
> application passes them to OpenJPA ?
> 
> I tried "operation-order" implementation, but it reorders statements and
> violates unique constraints in the database despite they are declared in
> persistence classes, even query data cache is switched on.
> 
> Best regards
> Georgi
> 
> 
> 
> 
> 



sql ordering

2008-08-24 Thread Georgi Naplatanov
Hello, everybody.

Is there a way to be executed generated SQL statements in order in which
application passes them to OpenJPA ?

I tried "operation-order" implementation, but it reorders statements and
violates unique constraints in the database despite they are declared in
persistence classes, even query data cache is switched on.

Best regards
Georgi






Re: strange data cache behaviour

2008-08-22 Thread Georgi Naplatanov
Hello, Nicklas.

I mean incorrect data. I tried runtime enhancement too, but without luck.

What about query data cache, is it working for you ? I mean
"openjpa.QueryCache".

Best regards
Georgi

Nicklas Johnson wrote:
> You didn't specify the way in which your test fails, but I did get
> unexpected caching behaviour from recent OpenJPA when I ran it without
> either static enhancement or specifying a javaagent at runtime.  You might
> want to check to be sure that you're specifying -javaagent or doing the
> bytecode enhancement on your entities prior to running your test.
> 
> 2008/8/22 Georgi Naplatanov <[EMAIL PROTECTED]>
> 
>> Hello, list.
>>
>> I test an application with OpenJPA 1.2.0 which reads and writes data to
>> a database.
>>
>> When the data cache is 0 or more than 1400 all is fine, but when the
>> data cache is between 1 and 1300, the test fails.
>>
>>
> 



strange data cache behaviour

2008-08-22 Thread Georgi Naplatanov
Hello, list.

I test an application with OpenJPA 1.2.0 which reads and writes data to
a database.

When the data cache is 0 or more than 1400 all is fine, but when the
data cache is between 1 and 1300, the test fails.

Before each query execution the application executes
EntityManager.flush() method.

OpenJPA is configured in extended context with Apache DBCP.

It is the test configuration:


  

 




Does anybody have similar problem ?

Best regards
Georgi


openjpa & DBCP

2008-06-18 Thread Georgi Naplatanov
Hello, list.

The configuration example -
"How do I enable connection pooling in OpenJPA?" at
http://openjpa.apache.org/faq.html, do not work for me.
The exmple is :



, but i use another example which i found in the internet :



which work, but i have another issue. When i close EntityManagerFactory
instance, it does not close db connections immediately.

I don't know where is the problem, in the configuration or it's OpenJPA
issue.

Best regards
Georgi


Re: JPA update entities every (even empty) commit

2008-04-17 Thread Georgi Naplatanov
Hello, Rajeev.

I did it.

Best regards
Georgi

Rajeev Jha wrote:
> Good that it worked for you. Can you please close openJPA-546 with
> your comments? I believe you need enhanced classes to detect dirty
> objects selectively :o)
> 
> Thanks
> 
> - rajeev.
> 
> 
> On Thu, Apr 17, 2008 at 4:54 AM, Georgi Naplatanov <[EMAIL PROTECTED]> wrote:
>> Hello, Rajeev.
>>
>>  I repeated the test with enhanced classes and didn't see this behavior.
>>  In my test i used OpenJPA 1.0.2.
>>
>>  Best regards
>>  Georgi
>>
>>
>>
>>  Rajeev Jha wrote:
>>  > hello Georgi
>>  > Do you see this behavior with enhanced classes also? like when I try
>>  > the same test case with enhanced classes , UPDATE is fired for only
>>  > the dirty objects. can you please verify this?
>>  >
>>  >
>>  > Thanks
>>  >
>>  > - rajeev.
>>  >
>>  >
>>  >
>>  > On Thu, Mar 27, 2008 at 12:30 PM, Georgi Naplatanov <[EMAIL PROTECTED]> 
>> wrote:
>>  >> Hello, Bardolf
>>  >>
>>  >>  I created bug report on JIRA -
>>  >>  https://issues.apache.org/jira/browse/OPENJPA-546
>>  >>
>>  >>  Let see OpenJPA developer's comments.
>>  >>
>>  >>  Best regards
>>  >>  Georgi
>>  >>
>>  >>
>>  >>
>>  >>  bardolf wrote:
>>  >>  > Hi Georgi,
>>  >>  > openJPA 1.0.1 does this, but I'm not sure if it is right behaviour.
>>  >>  > Toplink doesn't call update on unchanged entities, on the other hand 
>> it
>>  >>  > calls update on entity planned to be removed.
>>  >>  >
>>  >>  > Bardolf
>>  >>  >
>>  >>  > Georgi Naplatanov wrote:
>>  >>  >> Hello, everybody.
>>  >>  >>
>>  >>  >> Is the update on unchanged entities within transaction the right
>>  >>  >> behavior ?
>>  >>  >>
>>  >>  >> It's very important for my applications.
>>  >>  >>
>>  >>  >> I wrote the following example and all selected entities were updated 
>> :
>>  >>  >>
>>  >>  >> factory =
>>  >>  >> 
>> Persistence.createEntityManagerFactory("",System.getProperties()) ;
>>  >>  >> em = factory.createEntityManager() ;
>>  >>  >> em.getTransaction().begin() ;
>>  >>  >> Query q = em.createQuery("SELECT . ");
>>  >>  >> List l = q.getResultList() ;
>>  >>  >> System.out.println(l.size()) ;
>>  >>  >> em.getTransaction().commit() ;
>>  >>  >> em.close() ;
>>  >>  >> factory.close() ;
>>  >>  >>
>>  >>  >> My environment is :
>>  >>  >> OpenJPA 1.0.2
>>  >>  >> PostgreSQL 8.3.0
>>  >>  >>
>>  >>  >> Best regards
>>  >>  >> Georgi
>>  >>  >>
>>  >>  >
>>  >>
>>  >>
>>
>>



Re: JPA update entities every (even empty) commit

2008-04-16 Thread Georgi Naplatanov
Hello, Rajeev.

I repeated the test with enhanced classes and didn't see this behavior.
In my test i used OpenJPA 1.0.2.

Best regards
Georgi

Rajeev Jha wrote:
> hello Georgi
> Do you see this behavior with enhanced classes also? like when I try
> the same test case with enhanced classes , UPDATE is fired for only
> the dirty objects. can you please verify this?
> 
> 
> Thanks
> 
> - rajeev.
> 
> 
> 
> On Thu, Mar 27, 2008 at 12:30 PM, Georgi Naplatanov <[EMAIL PROTECTED]> wrote:
>> Hello, Bardolf
>>
>>  I created bug report on JIRA -
>>  https://issues.apache.org/jira/browse/OPENJPA-546
>>
>>  Let see OpenJPA developer's comments.
>>
>>  Best regards
>>  Georgi
>>
>>
>>
>>  bardolf wrote:
>>  > Hi Georgi,
>>  > openJPA 1.0.1 does this, but I'm not sure if it is right behaviour.
>>  > Toplink doesn't call update on unchanged entities, on the other hand it
>>  > calls update on entity planned to be removed.
>>  >
>>  > Bardolf
>>  >
>>  > Georgi Naplatanov wrote:
>>  >> Hello, everybody.
>>  >>
>>  >> Is the update on unchanged entities within transaction the right
>>  >> behavior ?
>>  >>
>>  >> It's very important for my applications.
>>  >>
>>  >> I wrote the following example and all selected entities were updated :
>>  >>
>>  >> factory =
>>  >> Persistence.createEntityManagerFactory("",System.getProperties()) ;
>>  >> em = factory.createEntityManager() ;
>>  >> em.getTransaction().begin() ;
>>  >> Query q = em.createQuery("SELECT . ");
>>  >> List l = q.getResultList() ;
>>  >> System.out.println(l.size()) ;
>>  >> em.getTransaction().commit() ;
>>  >> em.close() ;
>>  >> factory.close() ;
>>  >>
>>  >> My environment is :
>>  >> OpenJPA 1.0.2
>>  >> PostgreSQL 8.3.0
>>  >>
>>  >> Best regards
>>  >> Georgi
>>  >>
>>  >
>>
>>



Re: How to detect whether there are any dirty objects?

2008-04-12 Thread Georgi Naplatanov
Hello, David,

EntityTransaction.isActive() really don't do this. It's my mistake.

Because i'm interesting for this issue too, i make the following test,
but without success:

EntityManager em = emf.create EntityManager() ;
em.getTransaction.begin() ;
Query q = em.createQuery("DELETE FROM Myobject x") ;
q.executeUpdate() ;

OpenJPAEntityManager kem = OpenJPAPersistence.cast(em);

boolean isDirty = !(kem.getUpdatedClasses().isEmpty() &&
kem.getPersistedClasses().isEmpty() && kem.getRemovedClasses().isEmpty() ) ;

em.getTransaction().rollback() ;

But isDirty is always false. May be these methods do not work with queries.

Best regards
Georgi

David Goodenough wrote:
> On Friday 11 April 2008, Georgi Naplatanov wrote:
>> Hello, David.
>>
>> In your case EntityTransaction.isActive() should do the job.
>>
>> Best regards
>> Georgi
>>
>> David Goodenough wrote:
>>> Is there a way to detect whether there are any modified/dirty objects
>>> that need to be written to the datastore?  I do not need to know which
>>> objects are dirty, just whether there are any.
>>>
>>> I am trying to add the kind of functionality that puts up a question
>>> when someone tries to terminate the program without saving to
>>> point out that they need to save.
>>>
>>> Thanks,
>>>
>>> David
> 
> The reference manual says that isActive tells me whether begin has been
> called more recently than commit or rollback (section 9.2).  Are you saying
> that if begin has been called but nothing has been modified that it will also
> return true.  Also if the last thing that was called was commit or rollback
> and begin has not yet been called will it be true if something has been 
> modified?
> 
> David



Re: How to detect whether there are any dirty objects?

2008-04-11 Thread Georgi Naplatanov
Hello, David.

In your case EntityTransaction.isActive() should do the job.

Best regards
Georgi

David Goodenough wrote:
> Is there a way to detect whether there are any modified/dirty objects
> that need to be written to the datastore?  I do not need to know which 
> objects are dirty, just whether there are any.
> 
> I am trying to add the kind of functionality that puts up a question
> when someone tries to terminate the program without saving to 
> point out that they need to save.
> 
> Thanks,
> 
> David



Re: problems with ESCAPE function

2008-04-08 Thread Georgi Naplatanov
Hello, I forgot to say that OpenJPA version which  I use is 1.0.2.

Best regards
Georgi

Georgi Naplatanov wrote:
> Hello, everybody.
> 
> I tried to run the following JPQL query:
> SELECT x From MyObject x WHERE x.path LIKE ?1 ESCAPE '|'
> 
> but following exceptions occur:
> 
> 
> org.apache.openjpa.persistence.ArgumentException: An error occurred
> while parsing the query filter 'SELECT x From MyObject x WHERE x.path
> LIKE ?1 ESCAPE '|''. Error message:  nonfatal user error> org.apache.openjpa.kernel.jpql.ParseException:
> Encountered "ESCAPE" at character 125, but expected: ["AND", "GROUP",
> "HAVING", "OR", "ORDER", ].
>   at
> org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.parse(JPQLExpressionBuilder.java:1665)
>   at
> org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.(JPQLExpressionBuilder.java:1645)
>   at org.apache.openjpa.kernel.jpql.JPQLParser.parse(JPQLParser.java:47)
>   at
> org.apache.openjpa.kernel.ExpressionStoreQuery.newCompilation(ExpressionStoreQuery.java:144)
>   at
> org.apache.openjpa.datacache.QueryCacheStoreQuery.newCompilation(QueryCacheStoreQuery.java:236)
>   at 
> org.apache.openjpa.kernel.QueryImpl.newCompilation(QueryImpl.java:651)
>   at
> org.apache.openjpa.kernel.QueryImpl.compilationFromCache(QueryImpl.java:633)
>   at
> org.apache.openjpa.kernel.QueryImpl.compileForCompilation(QueryImpl.java:599)
>   at
> org.apache.openjpa.kernel.QueryImpl.compileForExecutor(QueryImpl.java:661)
>   at org.apache.openjpa.kernel.QueryImpl.getOperation(QueryImpl.java:1487)
>   at
> org.apache.openjpa.kernel.DelegatingQuery.getOperation(DelegatingQuery.java:123)
>   at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:227)
>   at
> org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:277)
>   at MainTest.test1(MainTest.java:51)
>   at MainTest.(MainTest.java:31)
>   at MainTest.main(MainTest.java:108)
> Caused by: 
> org.apache.openjpa.persistence.ArgumentException: Encountered "ESCAPE"
> at character 125, but expected: ["AND", "GROUP", "HAVING", "OR",
> "ORDER", ].
>   at
> org.apache.openjpa.kernel.jpql.JPQL.generateParseException(JPQL.java:9285)
>   at org.apache.openjpa.kernel.jpql.JPQL.jj_consume_token(JPQL.java:9162)
>   at org.apache.openjpa.kernel.jpql.JPQL.parseQuery(JPQL.java:75)
>   at
> org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.parse(JPQLExpressionBuilder.java:1658)
>   ... 15 more
> 
> 
> I don't know where the problem is.
> 
> In case parameter's placeholder (?1) is replaced with string ('mypath%'
> for example) ,  all is fine.
> 
> Best regards
> Georgi



problems with ESCAPE function

2008-04-08 Thread Georgi Naplatanov
Hello, everybody.

I tried to run the following JPQL query:
SELECT x From MyObject x WHERE x.path LIKE ?1 ESCAPE '|'

but following exceptions occur:


org.apache.openjpa.persistence.ArgumentException: An error occurred
while parsing the query filter 'SELECT x From MyObject x WHERE x.path
LIKE ?1 ESCAPE '|''. Error message:  org.apache.openjpa.kernel.jpql.ParseException:
Encountered "ESCAPE" at character 125, but expected: ["AND", "GROUP",
"HAVING", "OR", "ORDER", ].
at
org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.parse(JPQLExpressionBuilder.java:1665)
at
org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.(JPQLExpressionBuilder.java:1645)
at org.apache.openjpa.kernel.jpql.JPQLParser.parse(JPQLParser.java:47)
at
org.apache.openjpa.kernel.ExpressionStoreQuery.newCompilation(ExpressionStoreQuery.java:144)
at
org.apache.openjpa.datacache.QueryCacheStoreQuery.newCompilation(QueryCacheStoreQuery.java:236)
at 
org.apache.openjpa.kernel.QueryImpl.newCompilation(QueryImpl.java:651)
at
org.apache.openjpa.kernel.QueryImpl.compilationFromCache(QueryImpl.java:633)
at
org.apache.openjpa.kernel.QueryImpl.compileForCompilation(QueryImpl.java:599)
at
org.apache.openjpa.kernel.QueryImpl.compileForExecutor(QueryImpl.java:661)
at org.apache.openjpa.kernel.QueryImpl.getOperation(QueryImpl.java:1487)
at
org.apache.openjpa.kernel.DelegatingQuery.getOperation(DelegatingQuery.java:123)
at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:227)
at
org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:277)
at MainTest.test1(MainTest.java:51)
at MainTest.(MainTest.java:31)
at MainTest.main(MainTest.java:108)
Caused by: 
org.apache.openjpa.persistence.ArgumentException: Encountered "ESCAPE"
at character 125, but expected: ["AND", "GROUP", "HAVING", "OR",
"ORDER", ].
at
org.apache.openjpa.kernel.jpql.JPQL.generateParseException(JPQL.java:9285)
at org.apache.openjpa.kernel.jpql.JPQL.jj_consume_token(JPQL.java:9162)
at org.apache.openjpa.kernel.jpql.JPQL.parseQuery(JPQL.java:75)
at
org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.parse(JPQLExpressionBuilder.java:1658)
... 15 more


I don't know where the problem is.

In case parameter's placeholder (?1) is replaced with string ('mypath%'
for example) ,  all is fine.

Best regards
Georgi


Re: Setting Extended Persistence Context

2008-03-27 Thread Georgi Naplatanov
Hello, Michael,

You are right, it's my fault, but I want to switch persistence context
(Transaction/Extended) for some tests and have not luck with the example
from OpenJPA documentation.

Best regards
Georgi

Michael Dick wrote:
> Hi Georgi,
> 
> By default all application managed EntityManagers are extended, so you
> shouldn't have to do anything.
> 
> Are you seeing different behavior with OpenJPA?
> 
> -Mike
> 
> On Thu, Mar 27, 2008 at 2:40 AM, Georgi Naplatanov <[EMAIL PROTECTED]> wrote:
> 
>> Hello, everybody.
>>
>> How I can change context to "Extended Persistence Context" outside a EJB
>> container ?
>>
>> The example 3.1 of OpenJPA documentation don't compile due the error
>>
>> "em = factory.createEntityManager(PersistenceContextType.EXTENDED) ;
>>
>> The method createEntityManager(Map) in the type EntityManagerFactory is
>> not applicable for the arguments (PersistenceContextType)"
>>
>> Best regards
>> Georgi
>>
> 



Setting Extended Persistence Context

2008-03-27 Thread Georgi Naplatanov
Hello, everybody.

How I can change context to "Extended Persistence Context" outside a EJB
container ?

The example 3.1 of OpenJPA documentation don't compile due the error

"em = factory.createEntityManager(PersistenceContextType.EXTENDED) ;

The method createEntityManager(Map) in the type EntityManagerFactory is
not applicable for the arguments (PersistenceContextType)"

Best regards
Georgi


Re: JPA update entities every (even empty) commit

2008-03-27 Thread Georgi Naplatanov
Hello, Bardolf

I created bug report on JIRA -
https://issues.apache.org/jira/browse/OPENJPA-546

Let see OpenJPA developer's comments.

Best regards
Georgi

bardolf wrote:
> Hi Georgi,
> openJPA 1.0.1 does this, but I'm not sure if it is right behaviour.
> Toplink doesn't call update on unchanged entities, on the other hand it
> calls update on entity planned to be removed.
> 
> Bardolf
> 
> Georgi Naplatanov wrote:
>> Hello, everybody.
>>
>> Is the update on unchanged entities within transaction the right
>> behavior ?
>>
>> It's very important for my applications.
>>
>> I wrote the following example and all selected entities were updated :
>>
>> factory =
>> Persistence.createEntityManagerFactory("",System.getProperties()) ;
>> em = factory.createEntityManager() ;
>> em.getTransaction().begin() ;
>> Query q = em.createQuery("SELECT . ");
>> List l = q.getResultList() ;
>> System.out.println(l.size()) ;
>> em.getTransaction().commit() ;
>> em.close() ;
>> factory.close() ;
>>
>> My environment is :
>> OpenJPA 1.0.2
>> PostgreSQL 8.3.0
>>
>> Best regards
>> Georgi
>>
> 



Re: JPA update entities every (even empty) commit

2008-03-26 Thread Georgi Naplatanov

Hello, everybody.

Is the update on unchanged entities within transaction the right behavior ?

It's very important for my applications.

I wrote the following example and all selected entities were updated :

factory = 
Persistence.createEntityManagerFactory("",System.getProperties()) ;

em = factory.createEntityManager() ;
em.getTransaction().begin() ;
Query q = em.createQuery("SELECT . ");
List l = q.getResultList() ;
System.out.println(l.size()) ;
em.getTransaction().commit() ;
em.close() ;
factory.close() ;

My environment is :
OpenJPA 1.0.2
PostgreSQL 8.3.0

Best regards
Georgi


Re: Why would I choose OpenJPA over Hibernate?

2008-02-29 Thread Georgi Naplatanov

What version of OpenJPA will contain OpenJPA Slice ?

1.0.3, 1.1.0 ?

Best regards
Georgi

Patrick Linskey wrote:

For search-related issues, you might want to look at Compass [1]. For
data partitioning, you might want to take a look at the OpenJPA Slice
subproject, which Pinaki Poddar developed and recently contributed to
the OpenJPA trunk.

[1] http://www.compass-project.org/

-Patrick




Re: EntityManager.lock not working

2008-02-23 Thread Georgi Naplatanov

Hello, dain.

I have to use pessimistic locking with openjpa 1.0.2 and PostgreSQL 8.2.
Just put in persistance.xml




and when you want pessimistic lock set the following hint to a query

q.setHint("openjpa.FetchPlan.ReadLockMode","READ");

I made some tests and no matter what is lock mode "READ" or "WRITE" in
setHint() method.

In case you use other database than PostgreSQL which supports row-level
locking, tell if it works for you.

Regards
Georgi


Does that make all locks pessimistic?  I wouldn't want to kill
performance just to get SELECT FOR UPDATE.

-dain

On Feb 21, 2008, at 2:18 PM, Patrick Linskey wrote:


If you want pessimistic locks in OpenJPA, you'


ll need to set the openjpa.LockManager configuration setting to
'pessimistic'.

-Patrick

On Thu, Feb 21, 2008 at 2:16 PM, Patrick Linskey
<[EMAIL PROTECTED]> wrote:

If you want pessimistic locks in OpenJPA, you'



On Thu, Feb 21, 2008 at 1:53 PM, Evan Ireland <[EMAIL PROTECTED]>
wrote:

Dain,

Sounds like you are wanting a pessimistic lock. The semantics
of WRITE_LOCK are defined in optimistic terms in the spec.

The JPA 2.0 expert group is looking into this. In the mean time,
only non-portable apps can get this behaviour.




-Original Message-
From: Dain Sundstrom [mailto:[EMAIL PROTECTED]
Sent: Friday, 22 February 2008 9:50 a.m.
To: [EMAIL PROTECTED]
Subject: EntityManager.lock not working

I have a test case with two threads executing the following code:

public void run() {
try {
beginTx();

Employee david =
entityManager.getReference(Employee.class, pk);
entityManager.lock(david, LockModeType.WRITE);
entityManager.flush();

Assert.assertTrue(entityManager.contains(david));

Assert.assertEquals(david.getId(), pk);
Assert.assertEquals(david.getFirstName(), "David");
Assert.assertEquals(david.getLastName(), "Blevins");
Assert.assertEquals(100.0, david.getSalary());

log("READ");

// wait for other threads to read
try {
startBarrier.await(2, TimeUnit.SECONDS);
} catch (Exception e) {
}


log("WRITE");
david.setSalary(200);

} catch (Throwable throwable) {
this.throwable = throwable;
} finally {
try {
commitTx();
} catch (Throwable throwable) {
if (this.throwable == null) this.throwable =
throwable;
}
}
}

The first thread successfully reads the row and waits.  The
second throws an exception at the entityManager.flush()
command after the write lock.  I would assume that when I say
"give me a write lock"
OpenJPA would "give me a write lock".  Is there anyway to get
write lock in my application for single rows without having
to switch everything to SERIALIZABLE?

-dain








--
Patrick Linskey
202 669 5907





--
Patrick Linskey
202 669 5907