Trenton D. Adams | 17 Dec 01:21 2014
Picon

ClassCastException on maven enhancing

Good day,

I have a maven build.  When I run "mvn install" my unit tests run just 
fine, as does the enhancer...
[INFO] --- openjpa-maven-plugin:1.1:enhance (enhancer)  <at>  webdirectory ---
66  athome  INFO   [main] openjpa.Tool - Enhancer running on type 
"ca.tnt.athome.Town".
190  athome  INFO   [main] openjpa.Tool - Enhancer running on type 
"ca.tnt.athome.HouseListing".

But, when I run "mvn install tomcat:deploy", the enhancer plugin tries 
to run again, and this...

[INFO] --- openjpa-maven-plugin:1.1:enhance (enhancer)  <at>  webdirectory ---
An error occurred while attempting to determine the version of 
"file:/home/trenta/LocalDocuments/development/java/athome/web-directory/target/classes/META-INF/persistence.xml".
[INFO] 
------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] 
------------------------------------------------------------------------
[INFO] Total time: 9.535 s
[INFO] Finished at: 2014-12-16T17:18:11-07:00
[INFO] Final Memory: 13M/218M
[INFO] 
------------------------------------------------------------------------
[ERROR] Failed to execute goal 
org.codehaus.mojo:openjpa-maven-plugin:1.1:enhance (enhancer) on project 
webdirectory: Execution enhancer of goal 
org.codehaus.mojo:openjpa-maven-plugin:1.1:enhance failed: 
(Continue reading)

Pinaki Poddar | 12 Dec 20:20 2014
Picon

Re: OpenJPA support for JPA 2.1: when?

May of JPA 2.1 have been developed on the branch Kevin had mentioned. As it
was quite a while I had looked at beautiful OpenJPA code (i am now a FOB in
the wobbly-goobly-gook Python/Shell Script world filled with super-wizards
:), the exact features I had implemented on that branch escapes me.

The essentials are
1. Stored Procedure support was well-cooked as it required new
constructs/concepts in OpenJPA
2. Many low-hanging features that had been part of OpenJPA in alternative
form are adapted to JPA 2.1 form

Will take a look when i get some free time. 

Any new or old committers ready to contribute to OpenJPA are welcome to
offer a hand to drive these prototypes to completion. 

-----
Pinaki Poddar
Chair, Apache OpenJPA Project
--
View this message in context: http://openjpa.208410.n2.nabble.com/OpenJPA-support-for-JPA-2-1-when-tp7584157p7587494.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

jacksmith | 12 Dec 03:26 2014
Picon

OpenJPA generate wrong query when using postgres as DBDictionary

Our application is using OpenJPA 2.2 with Oracle, everything is working fine.

Now we need to move to postgres database, but we run into a basic issue, the
generated query is wrong, it has extra table in the FROM statement which
causes cartesian join.

any help will be deeply appreciated. if you need anything else, please let
me know.

It's also very easy to reproduce the issue, following is the method to
reproduce it:
/**
* with postgres as dbdictionay, this method produces wrong query like (with
oracle it works fine):
* SELECT t1.ORGN_ID FROM V_LOCATION t0 , T_DIM_ORGN t1 WHERE (t1.CLNT_OBJ_ID
= ?) 
* 
* the correct query should be like:
* SELECT t1.ORGN_ID FROM T_DIM_ORGN t1 WHERE (t1.CLNT_OBJ_ID = ?) 
*/
public void getDeptOptionsByUser(String filterId) {

        List<Predicate> predicates = new ArrayList<Predicate>();
	CriteriaBuilder cb = em.getCriteriaBuilder();
	CriteriaQuery<Tuple> cq = cb.createTupleQuery();

	/* the following line is purposely added to reproduce the issue. our real
application code is
	* much more complex and we don't have a way to bypass the issue
	*/
(Continue reading)

Roberto Cortez | 11 Dec 16:44 2014

Re: OpenJPA support for JPA 2.1: when?

Hi,
Forgive me with these very basic questions:
- All the JPA 2.1 work should be done in this svn
sandbox: https://svn.apache.org/repos/asf/openjpa/sandboxes/21?- Should we just pick a task
from the list here: http://openjpa.apache.org/jpa-2.1-tasks.html and contribute to it?- Since
I'm not a committer, should I just send the patches for the code?
Cheers,Roberto  
      From: Rick Curtis <curtisr7@...>
 To: users <users@...> 
Cc: Pinaki Poddar <pinaki.poddar@...> 
 Sent: Thursday, December 11, 2014 3:09 PM
 Subject: Re: OpenJPA support for JPA 2.1: when?

For those that are interested in this development effort, please take a
look at the jpa-2.1 development tasks[1]. There are some low hanging prelim
tasks that need to get taken care of prior to any real 2.1 work happening.

Pinaki -- I see you created a 2.1 development sandbox, do you have any info
on the changes that you've already started to prototype?

Thanks,
Rick

[1] http://openjpa.apache.org/jpa-2.1-tasks.html

On Tue, Dec 9, 2014 at 10:50 PM, David Blevins <david.blevins@...>
wrote:

> On Dec 8, 2014, at 11:55 AM, David Blevins <david.blevins@...>
> wrote:
(Continue reading)

Tester | 30 Nov 16:21 2014
Picon

Set cascading-persist gobally or through ReverseMappingTool

Dear OpenJPA community,

I use the OpenJPA ReverseMappingTool to programmatically create my
entities. The issues that I'm now encountering is the following error
message:

Suggested actions: a) Set the cascade attribute for this field to
CascadeType.PERSIST or CascadeType.ALL (JPA annotations) or "persist" or
"all" (JPA orm.xml),
 b) enable cascade-persist globally,
 c) ...

I see 3 possible solutions to change the CascadingType to Persist (the
ReverseMappingTool puts CascadinType.Merge by default it seems):
1) Pass a configuration to the ReverseMappingTool to add
CascadingType.Persist instead of the default CascadingType.Merge

=> I have been looking in the docs of the ReverseMappingTool, but I cannot
find a way to set it. Am I overlooking something?
2) Set CascadingType.Persist globally in a programmatic way.

=> I looked to add it through the JDBCConfiguration/OpenJPAConfiguration or
EntityManager, but here I still don't see way to set this globally
3) Manipulate the generated entity files. This is definitely possible, but
I would prefer option 1 or 2.

Anybody has an idea on how to achieve point 1 or 2?

Kind regards,
(Continue reading)

Charlie Mordant | 30 Nov 16:05 2014
Picon

OpenJPA and auto-commit

Hi OpenJPA Guru's,

I'm encountering an issue when openJPA participates to a global
transaction, I've got this weird error happening sometimes:

Caused by: <openjpa-2.3.0-r422266:1540826 nonfatal general error>
org.apache.openjpa.persistence.PersistenceException:
setAutoCommit(true) invalid during global transaction.

	at org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:559)

	at org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:455)

My persistence.xml is as simple as it can be:
[code]

<persistence-unit name="${project.artifactId}Pu" transaction-type="JTA">

 <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>

<jta-data-source>osgi:service/javax.sql.DataSource/(&amp;(
osgi.jndi.service.name
=${project.parent.artifactId}.database)(aries.managed=true))</
jta-data-source>

<properties>

 <property name="openjpa.Log" value="slf4j"/>

 <property name="openjpa.jdbc.SynchronizeMappings" value=
(Continue reading)

Robert G | 17 Nov 03:05 2014
Picon

None of the apache-openjpa-2.3.0-binary.zip download links work?

All of the download links return "Not Found" for me.

Thanks,
- Robert
Dave Westerman | 12 Nov 15:46 2014
Picon

Dynamic DataSource Selection with JPA

I am working with a group that has an application that has a very critical 
need for high availability and performance. To make a long story short, 
they want to use DB2 HADR for availability. But they also want to use the 
DB2 HADR read-on-standby facility if the application server is co-located 
with the database server, for performance reasons. 

The above details aren't really important here. But what I would like to 
know is if there is a way to dynamically choose which datasource the JPA 
calls will be using at runtime, based on some algorithm. All update calls 
to a JPA entity will always use the primary datasource. But if the entity 
is only being read, then the standby datasource may be the one used if the 
servers are co-located. 

I'm not sure if this is even feasible with JPA, but hopefully someone here 
can tell me. 

Thanks! 
Jörn Gersdorf | 10 Nov 08:30 2014
Picon

Enable Query Cache, but selectively

Hi,

I´d like to enable OpenJPA´s query cache in a selective way, i. e. it
should be disabled unless I enable it explicitly using
query.getFetchPlan().setQueryResult(true).

I´ve figured out that this requires
FetchConfigurationImpl$ConfigurationState#queryCache to be set to false by
default, however, there does not seem to be a configuration property for
this.

So I ended up subclassing JDBCBrokerFactory and configure this via property
openjpa.BrokerFactory (see code below).

However I wonder if there is an easier way to achieve this?

Thanks and best regards,
Jörn

Code:

<property name="openjpa.BrokerFactory"
value="de.dwpbank.wp2d.wprecon.model.cache.CustomJDBCBrokerFactory" />

public class CustomJDBCBrokerFactory extends JDBCBrokerFactory {

    public CustomJDBCBrokerFactory(JDBCConfiguration conf) {
        super(conf);
    }

(Continue reading)

Sandhya Turaga | 7 Nov 05:51 2014

Fw: Please unsubscribe me.

Hi Kevin, 
    I have sent an email to "users-unsubscribe@...e.org" to
unsubscribe me from user list as well. But I am not unsubscribed . Need help with this . Thanks.

      On Thursday, November 6, 2014 12:48 PM, Sandhya Turaga <turagasandy <at> yahoo.com> wrote:

 Please unsubscribe me . thanks.

   
Trenton D. Adams | 6 Nov 08:25 2014
Picon

Standalone Example

Hi Guys,

Where can I find the best openjpa standalone example?  Preferably with a 
maven build.  I have checked the site, and googled, and nothing decent 
seems to come up.

Thanks.


Gmane