Re: nonfatal general error +cast exception for dataCache.QueryKey in glassfish

2011-06-06 Thread Rick Curtis
Afsaneh -

Is the root problem that you tried to pin a native query or the fact that
the target type isn't cached by the DataCache?

On Sat, Jun 4, 2011 at 2:35 AM, afsaneh afsaneh.abo...@gmail.com wrote:

 Hi Rick,
 After deep debugging, I realized I'd made a mistake when I was pinning
 queries. I had included queries which data cache for their target classes
 wasn't enabled and also one of my queries was a named-native-query.
 So their query keies got became null.

 Thanks,
 Afsaneh




-- 
*Rick Curtis*


Re: Native SQL Query

2011-06-06 Thread Rick Curtis
I know this isn't a good answer, but is it possible to use JPQL as opposed
to native queries?

On Fri, Jun 3, 2011 at 3:40 PM, Chaos907 da...@edelements.com wrote:

 Below is our persistence.xml. When we are using the persistence-unit
 platform
 (no sharding), then createNativeQuery works. But if we use the
 persistence-unit platform-slice, then createNativeQuery fails with the
 stacktrace in the previous post.

 ?xml version=1.0 encoding=UTF-8?
 persistence version=2.0 xmlns=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;
persistence-unit name=platformTest_AWS
 transaction-type=RESOURCE_LOCAL
provider
org.apache.openjpa.persistence.PersistenceProviderImpl
/provider

properties

property name=javax.persistence.jdbc.driver
 value=com.mysql.jdbc.Driver/
property name=javax.persistence.jdbc.url
 value=jdbc:mysql://
 platformtest.co7yazhl6rhc.us-east-1.rds.amazonaws.com:3306/platform/
property name=javax.persistence.jdbc.user
 value=**/
property name=javax.persistence.jdbc.password
 value=**/

property name=openjpa.Log
 value=DefaultLevel=WARN, Tool=INFO/


property name=openjpa.QueryCache
 value=ehcache/
property name=openjpa.DataCacheManager
 value=ehcache/

/properties
/persistence-unit

persistence-unit name=platform transaction-type=RESOURCE_LOCAL
provider
org.apache.openjpa.persistence.PersistenceProviderImpl
/provider

properties

property name=openjpa.ConnectionDriverName
  value=com.mysql.jdbc.Driver/
property name=openjpa.ConnectionUserName
 value=**/
property name=openjpa.ConnectionPassword
 value=**/
property name=openjpa.ConnectionURL
  value=jdbc:mysql://
 127.0.0.1:3306/platform/

property name=openjpa.jdbc.SchemaFactory
 value=native(ForeignKeys=true)/

property name=openjpa.Log value=Runtime=TRACE,
 SQL=TRACE,
 DefaultLevel=WARN, Tool=INFO/

property name=openjpa.QueryCache
 value=ehcache/
property name=openjpa.DataCacheManager
 value=ehcache/

/properties
/persistence-unit
persistence-unit name=platform_slice
provider
org.apache.openjpa.persistence.PersistenceProviderImpl
/provider

properties
property name=openjpa.Log value=Runtime=TRACE,
 SQL=TRACE,
 DefaultLevel=TRACE, Tool=TRACE/
property name=openjpa.BrokerFactory
 value=slice/
property name=openjpa.slice.Names
 value=platform,platform1,platform2/
property name=openjpa.slice.Master
  value=platform/

property name=openjpa.slice.Lenient
 value=true/

property name=openjpa.ConnectionDriverName
  value=com.mysql.jdbc.Driver/
property name=openjpa.ConnectionUserName
 value=root/
property name=openjpa.ConnectionPassword
 value=99nfirst/
property
 name=openjpa.slice.platform.ConnectionURL
  value=jdbc:mysql://
 127.0.0.1:3306/platform/
property
 name=openjpa.slice.platform1.ConnectionURL
  value=jdbc:mysql://
 127.0.0.1:3306/platform1/
property
 name=openjpa.slice.platform2.ConnectionURL
  value=jdbc:mysql://
 127.0.0.1:3306/platform2/

property name=openjpa.slice.DistributionPolicy


 value=com.edelements.platform.service.openjpa.DistributeByInstitutionPolicy/
property name=openjpa.slice.FinderTargetPolicy

 value=com.edelements.platform.service.openjpa.ShardFinderTargetPolicy/
property name=openjpa.slice.ReplicationPolicy

 value=com.edelements.platform.service.openjpa.ShardReplicationPolicy/
property name=openjpa.slice.ReplicatedTypes
   value=/


property name=openjpa.QueryCache value=false/
property name=openjpa.DataCache value=false/


property name=openjpa.QueryCompilationCache
 value=false/
property name=openjpa.jdbc.QuerySQLCache
 value=false/
property name=openjpa.jdbc.FinderCache
 value=false/

property 

Re: Native SQL Query

2011-06-06 Thread Chaos907
For our application we want to support both native queries and JPQL. Does
open JPA not support native query under a distributed environment yet?

--
View this message in context: 
http://openjpa.208410.n2.nabble.com/Native-SQL-Query-tp6432918p6446011.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Re: Native SQL Query

2011-06-06 Thread Rick Curtis
I dug around the code a little bit and native queries don't work with
slice... I'm not sure if it is a simple bug to fix, or if it will take a
large effort to fix. Can I have you open a JIRA[1] for this bug?

[1] https://issues.apache.org/jira/browse/OPENJPA

On Mon, Jun 6, 2011 at 12:15 PM, Chaos907 da...@edelements.com wrote:

 For our application we want to support both native queries and JPQL. Does
 open JPA not support native query under a distributed environment yet?

 --


-- 
*Rick Curtis*


Re: Native SQL Query

2011-06-06 Thread Chaos907
I've created a JIRA issue for this bug:

https://issues.apache.org/jira/browse/OPENJPA-2008

--
View this message in context: 
http://openjpa.208410.n2.nabble.com/Native-SQL-Query-tp6432918p6447446.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


openjpa build time enhance using maven plugin DOESN'T WORK

2011-06-06 Thread infinity2heaven
Been trying to run try to run openjpa:enhance goal but it works on one
persistence module and not other.

plugin
groupIdorg.codehaus.mojo/groupId
artifactIdopenjpa-maven-plugin/artifactId
version1.2/version
configuration
includesxxx/core/entity/*.class/includes
addDefaultConstructortrue/addDefaultConstructor
enforcePropertyRestrictionstrue/enforcePropertyRestrictions 

/configuration
executions
execution
idJPA Enhance/id
phaseprocess-classes/phase
goals
goalenhance/goal
/goals
/execution
/executions
dependencies
dependency
groupIdorg.apache.openjpa/groupId
artifactIdopenjpa/artifactId
version${openjpa.version}/version
/dependency
/dependencies
/plugin

Exception thrown
Execution default-cli of goal
org.codehaus.mojo:openjpa-maven-plugin:1.2:enhance failed: MetaDataFactory 
could not be configured (conf.newMetaDataFactoryInstance() returned null).
This might mean that no configuration properties were found. Ensure that you
have a META-INF/persistence.xml file, that it is available in your
classpath, or that the properties file you are using for.

The persistence.xml is in the CLASSPATH, yes. Everything is just fine I
double checked several times. Another module of mine doesn't have this
issue.

What am I missing?


--
View this message in context: 
http://openjpa.208410.n2.nabble.com/openjpa-build-time-enhance-using-maven-plugin-DOESN-T-WORK-tp6446547p6446547.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Re: Native SQL Query

2011-06-06 Thread lspasam
Additional information I found, is that this only happens in a Distributed
environment (Slice).  Below is the method that is returning null for
ExpressionParser.  At this point in execution, language is openJpa.SQL. 
There doesn't seem to be an ExpressionParser mapped to this language.



public StoreQuery newQuery(String language) {
ExpressionParser parser =
QueryLanguages.parserForLanguage(language);
DistributedStoreQuery ret = new DistributedStoreQuery(this, parser);
for (SliceStoreManager slice : _slices) {
ret.add(slice.newQuery(language));
}
return ret;
}


Is this a bug or is native queries not going to be supported in a sliced
environment?



--
View this message in context: 
http://openjpa.208410.n2.nabble.com/Native-SQL-Query-tp6432918p6433509.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.