Re: Wrong SQL statement being generated

2012-04-29 Thread Ravi P Palacherla
Unable to replicate the issue on oracle DB.

openJPA version:
OpenJPA 1.2.3-SNAPSHOT

Here is the SQL I am seeing:
SELECT t0.ID, t1.EXPORT_ORDER_ID, t1.VM_ID FROM weblogic.EXPORT_ORDER t0,
weblogic.EXPORT_ORDER_VM t1 WHERE t0.ID = t1.EXPORT_ORDER_ID ORDER BY t0.ID
ASC

Testcase is here:
http://openjpa.208410.n2.nabble.com/file/n7512197/openjpa123_testcase.jar
openjpa123_testcase.jar 

It was run against oracle DB:
mvn test -Dtest=TestNamedQuery -DfailIfNoTests=false -Ptest-custom  
-Dopenjpa.custom.driverjar=/scratch/rpalache/WLS/WLS10MP2/wlserver_10.0/server/lib/ojdbc14.jar
  
-Dopenjpa.custom.driverclass=oracle.jdbc.driver.OracleDriver  
-Dopenjpa.custom.url=jdbc:oracle:thin:@   -Dopenjpa.custom.username= 
-Dopenjpa.custom.password=

I developed the testcase from the source code posted in this thread.

Regards,
Ravi.

--
View this message in context: 
http://openjpa.208410.n2.nabble.com/Wrong-SQL-statement-being-generated-tp7470306p7512197.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Stuck threads at Schema.getTable.

2011-03-27 Thread Ravi P Palacherla
Hi ,

I see following stuck threads in openJPA code :

 java.lang.Thread.State: RUNNABLE 
   at java.util.TreeMap.getEntry(TreeMap.java:328) 
   at java.util.TreeMap.get(TreeMap.java:255) 
   at org.apache.openjpa.jdbc.schema.Schema.getTable(Schema.java:115) 

I think the root cause of the issue is because of unsynchronized TreeMap.

There is a sun issue that explains the same about a hashMap and I think this
is also because of the same issue explained in: 
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6423457

So, the fix is to synchronize the TreeMap but I do not have a replicable
test case.

I created a simple testcase that will create around 10 treeMap entries
and then around 50 threads trying to access this treeMap but unable to
replicate the issue.

Please suggest what you think should be done.
Can I just submit the code fix ( synchronizing the treemap) and the test
case ( even though unable to replicate ) ?

Regards,
Ravi.

--
View this message in context: 
http://openjpa.208410.n2.nabble.com/Stuck-threads-at-Schema-getTable-tp6213602p6213602.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Re: cursor/prepared statement problem with WebLogic 10.3.2

2010-11-23 Thread Ravi P Palacherla

I am also not familiar with spy logs. I approached a colleague who is good at
this and here is what his suggestions are:

1 - Quick workaround: Turn off WLS statement caching (set cache size to 0)
2 - Get latest version of the rebranded driver from Oracle. That may fix the
problem, allowing statement caching again. If not, file a DD Driver bug with
Oracle.

This should be replicable outside openJPA with simple jdbc calls (calling
same prepared statement twice). If you just repeat the exact same jdbc calls
(that you see in spy logs), then you should be able to replicate the issue. 
The question is whether this happens *every time* a prepared statement for
the same SQL is re-used. It is either a simple driver bug (where the cleanup
JDBC code WLS do under the covers is messing up the DBMS's cursor state), or
if there is some other application activity that messes up the DBMS (not as
likely).
-- 
View this message in context: 
http://openjpa.208410.n2.nabble.com/cursor-prepared-statement-problem-with-WebLogic-10-3-2-tp5724027p5767713.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Re: cursor/prepared statement problem with WebLogic 10.3.2

2010-11-19 Thread Ravi P Palacherla

If it is replicable on customer's dev/test environment, then is it possible
to use spy log ?
If you are using weblogic branded db2 driver then you can enable the spy log
with following parameters in the URL:
jdbc:weblogic:db2://rtdc60018:48056
becomes
jdbc:weblogic:db2://rtdc60018:48056;spyAttributes=(log=(file)spy.log;timestamp=yes;logTName=yes)
-- 
View this message in context: 
http://openjpa.208410.n2.nabble.com/cursor-prepared-statement-problem-with-WebLogic-10-3-2-tp5724027p5755745.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


DB2 on zOS

2010-06-04 Thread Ravi P Palacherla

Hi,

I have an openJPA application that works fine on DB2/6000 server system but
the same application throws optimistic exception on DB2 zOS mainframe
system.

Is openJPA supported on DB2 zOS mainframe system ? Also what could be the
difference between DB2 on server system and mainframe system ? Can some one
please help me on how I can debug this issue. What is the information that I
should gather to find the issue on zOS mainframe system.

Regards,
Ravi.
-- 
View this message in context: 
http://openjpa.208410.n2.nabble.com/DB2-on-zOS-tp5139988p5139988.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


RE: After statting the server login time taking 2 minutes

2010-04-27 Thread Ravi P Palacherla

What version of openJPA are you using ?

Is the application gaining performance after running for some time ? If yes
then enhancing at build time will definitely help. I think as Jean pointed
out it is better to enhance at build time regardless.

What about thread dumps ? Can you please  take 3-4 thread dumps in an
interval of 15-20secs, at the time of delay.   (kill -3 process if of
server in unix based machines will give threaddump in the stdout.
On windows you can use ctrl-break on your command prompt that starts the
server)

Regards,
Ravi.
-- 
View this message in context: 
http://openjpa.208410.n2.nabble.com/After-statting-the-server-login-time-taking-2-minutes-tp4962106p4968492.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Re: How to specifiy Cascase None for OneToMany

2010-01-20 Thread Ravi P Palacherla

Hi,

Hmm... It worked for me on a standalone openJPA testcase against derby DB.

As you are running on WLS and against oracle DB, I created a testcase with
similar environment.

http://n2.nabble.com/file/n4432179/EJBTestCase.zip EJBTestCase.zip 

Please download the attached zip file. Modify build.xml,
build-properties.xml and META-INF\persistence.xml to reflect your local
environment.

Then run 
ant  ( this will create db tables , build EJB and deploy it on WLS)
ant test.remote  ( this will run the EJB which will remove the primary row
and insert new entitys)

After running the above testcase, I can clearly see that the foreignkey
column is nullified when I remove the primay row ( using em.remove())

Regards,
Ravi.
-- 
View this message in context: 
http://n2.nabble.com/How-to-specifiy-Cascase-None-for-OneToMany-tp4426059p4432179.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


About generated source in openjpa-kernel

2010-01-07 Thread Ravi P Palacherla

Hi All,

I checked out svn branch 0.9.7-r547073 revision 724510.

When I try to do mvn package -DskipTests I get the following exception :

C:\openJPA\0.9.7-r547073_r724510\openjpa-kernel\target\generated-source
s\javacc\org\apache\openjpa\kernel\jpql\org\apache\openjpa\kernel\jpql\JPQL.java
:[9262,24] generics are not supported in -source 1.4
(try -source 1.5 to enable generics)
  private java.util.Listint[] jj_expentries = new
java.util.ArrayListint[]()
;

Looks like javacc-maven-plugin inside openjpa-kernel/pom.xml is getting the
latest javacc plugin which is using generics to generate the source code.

To resolve the issue, I had to add version2.5/version for
javacc-maven-plugin to openjpa-kernel/pom.xml.

Should I open a JIRA and check in the above change (or) is there a better
solution for this issue ?

Regards,
Ravi.
-- 
View this message in context: 
http://n2.nabble.com/About-generated-source-in-openjpa-kernel-tp4268662p4268662.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Re: Open JPA generates incorrect Union All for Date and Boolean Datatype

2009-12-10 Thread Ravi P Palacherla
(ReflectiveMethodInvocation.java:176)
   at
 com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:210)
   at $Proxy142.testType(Unknown Source)
   at
 com.tieto.magic.poc.domain.DomainServicesBean_au5mn8_DomainServicesRImpl.testType(DomainServicesBean_au5mn8_DomainServicesRImpl.java:65)
   at
 com.tieto.magic.poc.domain.DomainServicesBean_au5mn8_DomainServicesRImpl_WLSkel.invoke(Unknown
 Source)
   at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
   at
 weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
   at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:477)
   at
 weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
   at weblogic.security.service.SecurityManager.runAs(Unknown Source)
   at
 weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:473)
   at
 weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
   at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
   at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
 Caused by: java.lang.Exception:
 org.apache.openjpa.lib.jdbc.ReportingSQLException: [BEA][Oracle JDBC
 Driver][Oracle]ORA-01790: expression must have same datatype as
 corresponding expression
  {prepstmnt 2625 SELECT 0, t0.ID, t0.version, t0.master_Ref, t0.NAME_F,
 '', 0, NULL, '', 0, 0, '1970-01-01', '', 0.0 FROM AddOn_T t0 WHERE t0.ID =
 ? UNION ALL SELECT 1, t0.ID, t0.version, t0.addOn_Ref, t0.NAME_F, '', 0,
 NULL, '', 0, 0, '1970-01-01', '', 0.0 FROM Master_T t0 WHERE t0.ID = ?
 UNION ALL SELECT 2, t0.ID, t0.version, t0.NAME_F, t0.primaryMaster_Ref,
 t0.secondaryMaster_Ref, 0, NULL, '', 0, 0, '1970-01-01', '', 0.0 FROM
 Slave_T t0 WHERE t0.ID = ? UNION ALL SELECT 3, t0.ID, t0.version,
 t0.addOn_Ref, t0.NAME_F, '', 0, NULL, '', 0, 0, '1970-01-01', '', 0.0 FROM
 SubAddOn_T t0 WHERE t0.ID = ? UNION ALL SELECT 4, t0.ID, t0.version,
 t0.NAME_F, t0.slave_Ref, '', 0, NULL, '', 0, 0, '1970-01-01', '', 0.0 FROM
 SubSlave_T t0 WHERE t0.ID = ? UNION ALL SELECT 5, t0.ID, t0.version, '',
 '', '', t0.COUNTER_F, t0.DATA_F, t0.ENUMED1_F, t0.ENUMED2_F, t0.FLAG_F,
 t0.MOMENT_F, t0.NAME_F, t0.VALUE_F FROM TYPED_T t0 WHERE t0.ID = ?
 [params=(String) 34B85860E33211DE984DF2390A53043A, (String)
 34B85860E33211DE984DF2390A53043A, (String)
 34B85860E33211DE984DF2390A53043A, (String)
 34B85860E33211DE984DF2390A53043A, (String)
 34B85860E33211DE984DF2390A53043A, (String)
 34B85860E33211DE984DF2390A53043A]} [code=1790, state=HY000]
   at
 org.apache.openjpa.util.Exceptions.replaceNestedThrowables(Exceptions.java:249)
   at
 org.apache.openjpa.persistence.PersistenceException.writeObject(PersistenceException.java:100)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at
 java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
   at
 java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461)
   at
 java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
   at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
   at
 java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
   at
 java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
   at
 java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
   at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
   at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
   at
 weblogic.rjvm.MsgAbbrevOutputStream.writeObject(MsgAbbrevOutputStream.java:618)
   at
 weblogic.rjvm.MsgAbbrevOutputStream.sendThrowable(MsgAbbrevOutputStream.java:471)
   at
 weblogic.rmi.internal.BasicServerRef.handleThrowable(BasicServerRef.java:694)
   at
 weblogic.rmi.internal.BasicServerRef.postInvoke(BasicServerRef.java:650)
   at
 weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:492)
   ... 3 more
 
 
 
  http://n2.nabble.com/file/n4138239/SampleEJBEar.ear SampleEJBEar.ear 
 
 Ravi P Palacherla wrote:
 
 Looks like the SampleEJB.ear in the attachment is not a correct ear.
 I am unable to deploy it on Weblogic server.
 
 Also the configuration files (like persistence.xml) and entities are
 missing in the attachment without which I may not be able to tell what
 configuration you are using.
 
 Are you using openJPA configurations or kodo configurations ?
 There was a known issue with a CLOB data type when kodo configuration is
 used. 
 The fix for this is in kodo files, it overrides openJPA's classes in
 order to fix it.
 
 Before

Re: Open JPA generates incorrect Union All for Date and Boolean Datatype

2009-12-10 Thread Ravi P Palacherla

Hi Himadri,

I am able to replicate the issue even after adding
providerorg.apache.openjpa.persistence.PersistenceProviderImpl/provider 

I will look into it further and will give you an update if I find anything
useful.

Regards,
Ravi.


Himadri wrote:
 
 
 
 Hi,
 
 This is strange. The problem comes when I add Child Associations to the
 entity. If I remove Child Asscoiations , all work fine. I have attached my
 Sample here. 
 Please see JPG for Entity Associations. SampleEJB.ear is the deployable
 ear on WL10.3. 
 
 Let me know if you find out anything .. for now I have replace all em.find
 with em.createQuery(Select ...) , But will like to know the real reason
 behind it ! 
 
 Lemme know if I can provide more simplified sample 
 
 Thanks,
 Himadri 
 
 
 
 From: Kevin Sutter [via OpenJPA]
 ml-node+4103283-1191879...@n2.nabble.com
 To: himadri hima_...@yahoo.co.in
 Sent: Thu, 3 December, 2009 5:39:17 AM
 Subject: Re: Open JPA generates incorrect Union All for Date and Boolean
 Datatype
 
 This sounds very strange.  From your description, I have no idea why Date 
 and Boolean attributes are having problems with Oracle.  And, why a Union 
 All is being generated for a simple find operation baffles me as well. 
 Unless there is some inheritance or eagerly fetched relationships
 involved. 
 Still, I thought OpenJPA used Joins over Unions. 
 
 Can you simplify the problem to a simple testcase that could be provided? 
 
 Thanks, 
 Kevin 
 
 On Tue, Dec 1, 2009 at 7:15 AM, himadri [hidden email] wrote: 
 
 
 
 Hi, 
 
 I have an EJB3.0 application deployed on Weblogic 10.3 and Oracle 10g DB.
 I 
 have an entity Typed which has Date and Boolean datatypes. em.persist is 
 sucessful. 
 
 But whereever there is em.find() on any entity in this application , I
 have 
 observed that open JPA  tries to get Union  of all entities. This may be 
 because its first time , But it fails with exception 
 
 [BEA][Oracle JDBC Driver][Oracle]ORA-01790:expression must have same 
 datatype as corresponding expression 
 
 The SQL generated is union all of all entities in the application . For 
 boolean FLAG_F , MOMENT_F wrong sql is generated. It should have to_date 
 function for date. I have used DATE and boolean in Entity class. 
 
 SELECT 0, t0.ID, t0.version, t0.NAME_F, '', 0, NULL, '', 0, 0, 
 '1970-01-01', 
 '', 0.0 FROM AddOn_T t0 WHERE t0.ID = ? 
 UNION ALL 
 SELECT 1, t0.ID, t0.version, '', '', t0.COUNTER_F, t0.DATA_F,
 t0.ENUMED1_F, 
 t0.ENUMED2_F, t0.FLAG_F, t0.MOMENT_F, t0.NAME_F, t0.VALUE_F FROM TYPED_T
 t0 
 WHERE t0.ID = ? [params=(String) 30, (String) 30]} [code=1790,
 state=HY000] 
 
 I guess openJPA fails to add to_date function for DATE and surrounding 
 chars 
 for boolean. Is this a bug or some settings available.  Why is it trying
 to 
 get union all even for em.find(... ) ? 
 
 Thanks in advance.. 
 - H 
 
 
 
 
 
 
 -- 
 View this message in context: 
 http://n2.nabble.com/Open-JPA-generates-incorrect-Union-All-for-Date-and-Boolean-Datatype-tp4093559p4093559.html
 Sent from the OpenJPA Users mailing list archive at Nabble.com. 
 
 
 
 
 
 View message @
 http://n2.nabble.com/Open-JPA-generates-incorrect-Union-All-for-Date-and-Boolean-Datatype-tp4093559p4103283.html
  
 To unsubscribe from Open JPA generates incorrect Union All for Date and
 Boolean Datatype, click here. 
 
 
 
   The INTERNET now has a personality. YOURS! See your Yahoo! Homepage.
 http://in.yahoo.com/
  
 

-- 
View this message in context: 
http://n2.nabble.com/Open-JPA-generates-incorrect-Union-All-for-Date-and-Boolean-Datatype-tp4093559p4149331.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Re: Open JPA generates incorrect Union All for Date and Boolean Datatype

2009-12-10 Thread Ravi P Palacherla
)
   at
 weblogic.rmi.internal.BasicServerRef.postInvoke(BasicServerRef.java:650)
   at
 weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:492)
   ... 3 more
 
 
 
  http://n2.nabble.com/file/n4138239/SampleEJBEar.ear SampleEJBEar.ear 
 
 Ravi P Palacherla wrote:
 
 Looks like the SampleEJB.ear in the attachment is not a correct ear.
 I am unable to deploy it on Weblogic server.
 
 Also the configuration files (like persistence.xml) and entities are
 missing in the attachment without which I may not be able to tell what
 configuration you are using.
 
 Are you using openJPA configurations or kodo configurations ?
 There was a known issue with a CLOB data type when kodo configuration is
 used. 
 The fix for this is in kodo files, it overrides openJPA's classes in
 order to fix it.
 
 Before going into details of the fix, Please attach a replicable
 testcase.
 That way I can see if the same fix applies for your scenario or not.
 
 It would be great if you are able to replicate the issue with openJPA
 configuration itself; we can work together on resolving the issue in
 openJPA itself.
 
 Also there were some workarounds of setting
 SubclassFetchMode=none;which I would not completely recommend with out
 understanding your complete environment.
 
 Regards,
 Ravi.
 
 
 himadri wrote:
 
 
 
 Hi,
 
 This is strange. The problem comes when I add Child Associations to the
 entity. If I remove Child Asscoiations , all work fine. I have attached
 my Sample here. 
 Please see JPG for Entity Associations. SampleEJB.ear is the deployable
 ear on WL10.3. 
 
 Let me know if you find out anything .. for now I have replace all
 em.find with em.createQuery(Select ...) , But will like to know the real
 reason behind it ! 
 
 Lemme know if I can provide more simplified sample 
 
 Thanks,
 Himadri 
 
 
 
 From: Kevin Sutter [via OpenJPA]
 ml-node+4103283-1191879...@n2.nabble.com
 To: himadri hima_...@yahoo.co.in
 Sent: Thu, 3 December, 2009 5:39:17 AM
 Subject: Re: Open JPA generates incorrect Union All for Date and Boolean
 Datatype
 
 This sounds very strange.  From your description, I have no idea why
 Date 
 and Boolean attributes are having problems with Oracle.  And, why a
 Union 
 All is being generated for a simple find operation baffles me as well. 
 Unless there is some inheritance or eagerly fetched relationships
 involved. 
 Still, I thought OpenJPA used Joins over Unions. 
 
 Can you simplify the problem to a simple testcase that could be
 provided? 
 
 Thanks, 
 Kevin 
 
 On Tue, Dec 1, 2009 at 7:15 AM, himadri [hidden email] wrote: 
 
 
 
 Hi, 
 
 I have an EJB3.0 application deployed on Weblogic 10.3 and Oracle 10g
 DB. I 
 have an entity Typed which has Date and Boolean datatypes. em.persist
 is 
 sucessful. 
 
 But whereever there is em.find() on any entity in this application , I
 have 
 observed that open JPA  tries to get Union  of all entities. This may
 be 
 because its first time , But it fails with exception 
 
 [BEA][Oracle JDBC Driver][Oracle]ORA-01790:expression must have same 
 datatype as corresponding expression 
 
 The SQL generated is union all of all entities in the application . For 
 boolean FLAG_F , MOMENT_F wrong sql is generated. It should have
 to_date 
 function for date. I have used DATE and boolean in Entity class. 
 
 SELECT 0, t0.ID, t0.version, t0.NAME_F, '', 0, NULL, '', 0, 0, 
 '1970-01-01', 
 '', 0.0 FROM AddOn_T t0 WHERE t0.ID = ? 
 UNION ALL 
 SELECT 1, t0.ID, t0.version, '', '', t0.COUNTER_F, t0.DATA_F,
 t0.ENUMED1_F, 
 t0.ENUMED2_F, t0.FLAG_F, t0.MOMENT_F, t0.NAME_F, t0.VALUE_F FROM
 TYPED_T t0 
 WHERE t0.ID = ? [params=(String) 30, (String) 30]} [code=1790,
 state=HY000] 
 
 I guess openJPA fails to add to_date function for DATE and surrounding 
 chars 
 for boolean. Is this a bug or some settings available.  Why is it
 trying to 
 get union all even for em.find(... ) ? 
 
 Thanks in advance.. 
 - H 
 
 
 
 
 
 
 -- 
 View this message in context: 
 http://n2.nabble.com/Open-JPA-generates-incorrect-Union-All-for-Date-and-Boolean-Datatype-tp4093559p4093559.html
 Sent from the OpenJPA Users mailing list archive at Nabble.com. 
 
 
 
 
 
 View message @
 http://n2.nabble.com/Open-JPA-generates-incorrect-Union-All-for-Date-and-Boolean-Datatype-tp4093559p4103283.html
  
 To unsubscribe from Open JPA generates incorrect Union All for Date and
 Boolean Datatype, click here. 
 
 
 
   The INTERNET now has a personality. YOURS! See your Yahoo!
 Homepage. http://in.yahoo.com/
  
 
 
 
 
 

-- 
View this message in context: 
http://n2.nabble.com/Open-JPA-generates-incorrect-Union-All-for-Date-and-Boolean-Datatype-tp4093559p4149434.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Re: Open JPA generates incorrect Union All for Date and Boolean Datatype

2009-12-07 Thread Ravi P Palacherla

Looks like the SampleEJB.ear in the attachment is not a correct ear.
I am unable to deploy it on Weblogic server.

Also the configuration files (like persistence.xml) and entities are missing
in the attachment without which I may not be able to tell what configuration
you are using.

Are you using openJPA configurations or kodo configurations ?
There was a known issue with a CLOB data type when kodo configuration is
used. 
The fix for this is in kodo files, it overrides openJPA's classes in order
to fix it.

Before going into details of the fix, Please attach a replicable testcase.
That way I can see if the same fix applies for your scenario or not.

It would be great if you are able to replicate the issue with openJPA
configuration itself; we can work together on resolving the issue in openJPA
itself.

Also there were some workarounds of setting SubclassFetchMode=none;which I
would not completely recommend with out understanding your complete
environment.

Regards,
Ravi.


himadri wrote:
 
 
 
 Hi,
 
 This is strange. The problem comes when I add Child Associations to the
 entity. If I remove Child Asscoiations , all work fine. I have attached my
 Sample here. 
 Please see JPG for Entity Associations. SampleEJB.ear is the deployable
 ear on WL10.3. 
 
 Let me know if you find out anything .. for now I have replace all em.find
 with em.createQuery(Select ...) , But will like to know the real reason
 behind it ! 
 
 Lemme know if I can provide more simplified sample 
 
 Thanks,
 Himadri 
 
 
 
 From: Kevin Sutter [via OpenJPA]
 ml-node+4103283-1191879...@n2.nabble.com
 To: himadri hima_...@yahoo.co.in
 Sent: Thu, 3 December, 2009 5:39:17 AM
 Subject: Re: Open JPA generates incorrect Union All for Date and Boolean
 Datatype
 
 This sounds very strange.  From your description, I have no idea why Date 
 and Boolean attributes are having problems with Oracle.  And, why a Union 
 All is being generated for a simple find operation baffles me as well. 
 Unless there is some inheritance or eagerly fetched relationships
 involved. 
 Still, I thought OpenJPA used Joins over Unions. 
 
 Can you simplify the problem to a simple testcase that could be provided? 
 
 Thanks, 
 Kevin 
 
 On Tue, Dec 1, 2009 at 7:15 AM, himadri [hidden email] wrote: 
 
 
 
 Hi, 
 
 I have an EJB3.0 application deployed on Weblogic 10.3 and Oracle 10g DB.
 I 
 have an entity Typed which has Date and Boolean datatypes. em.persist is 
 sucessful. 
 
 But whereever there is em.find() on any entity in this application , I
 have 
 observed that open JPA  tries to get Union  of all entities. This may be 
 because its first time , But it fails with exception 
 
 [BEA][Oracle JDBC Driver][Oracle]ORA-01790:expression must have same 
 datatype as corresponding expression 
 
 The SQL generated is union all of all entities in the application . For 
 boolean FLAG_F , MOMENT_F wrong sql is generated. It should have to_date 
 function for date. I have used DATE and boolean in Entity class. 
 
 SELECT 0, t0.ID, t0.version, t0.NAME_F, '', 0, NULL, '', 0, 0, 
 '1970-01-01', 
 '', 0.0 FROM AddOn_T t0 WHERE t0.ID = ? 
 UNION ALL 
 SELECT 1, t0.ID, t0.version, '', '', t0.COUNTER_F, t0.DATA_F,
 t0.ENUMED1_F, 
 t0.ENUMED2_F, t0.FLAG_F, t0.MOMENT_F, t0.NAME_F, t0.VALUE_F FROM TYPED_T
 t0 
 WHERE t0.ID = ? [params=(String) 30, (String) 30]} [code=1790,
 state=HY000] 
 
 I guess openJPA fails to add to_date function for DATE and surrounding 
 chars 
 for boolean. Is this a bug or some settings available.  Why is it trying
 to 
 get union all even for em.find(... ) ? 
 
 Thanks in advance.. 
 - H 
 
 
 
 
 
 
 -- 
 View this message in context: 
 http://n2.nabble.com/Open-JPA-generates-incorrect-Union-All-for-Date-and-Boolean-Datatype-tp4093559p4093559.html
 Sent from the OpenJPA Users mailing list archive at Nabble.com. 
 
 
 
 
 
 View message @
 http://n2.nabble.com/Open-JPA-generates-incorrect-Union-All-for-Date-and-Boolean-Datatype-tp4093559p4103283.html
  
 To unsubscribe from Open JPA generates incorrect Union All for Date and
 Boolean Datatype, click here. 
 
 
 
   The INTERNET now has a personality. YOURS! See your Yahoo! Homepage.
 http://in.yahoo.com/
  
 

-- 
View this message in context: 
http://n2.nabble.com/Open-JPA-generates-incorrect-Union-All-for-Date-and-Boolean-Datatype-tp4093559p4130072.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Re: insertable/updatable = false question

2009-08-13 Thread Ravi P Palacherla

Hi,

I think I found a better solution.

after flush() 
call em.refresh(e2)
This will refresh the state of e2 from the datastore. 

now e2.gete1() should return NON-NULL value.

Previously, it was not working because even though flush() updates the
datastore with values of e2.
The next call e2.gete1() is not going to datastore but using the e2's state
in the persistenceContext.

Please try and let me know if it has any issues.

Regards,
Ravi.


ljnelson wrote:
 
 On Thu, Aug 13, 2009 at 4:39 PM, Ravi P Palacherla (via Nabble) 
 ml-user+194843-327306...@n2.nabble.comml-user%2b194843-327306...@n2.nabble.com
 wrote:
 
 Hi Laird,

 I also think that you should get a NON-NULL for e2.gete1() after flush,
 provided e2 is managed at the time you are doing e2.gete1().

 
 Interestingly enough, I have run this using all the persistence providers,
 and they all give me NULL.  I just can't see reading the spec that way,
 but
 everyone has, I guess.
 
 Let me try your suggestion.
 
 Thanks,
 Laird
 
 

-- 
View this message in context: 
http://n2.nabble.com/insertable-updatable-%3D-false-question-tp3439111p3441686.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Re: inconsistent SQL's RESOURCE_LOCAL Vrs JTA

2009-07-27 Thread Ravi P Palacherla

Hi,

My guess is that the SQL generation should not be different between JTA and
RESOURCE_LOCAL.

Can you please add default trace level logging to both the scenarios and
attach the logs here.

That way we can compare between both scenarios and find if there are any
differences in the properties between JTA and RESOURCE_LOCAL.

You may already know, adding property name=openjpa.Log
value=DefaultLevel=TRACE/ to persistence.xml will set the logging level
to trace.

Regards,
Ravi.


brobbsnet wrote:
 
 please my project runs ok and generate all Sql statements under
 RESOURCE_LOCAL persistence.xml. when i change to run in the container
 using JTA , it does not generate the same number on sql statements causing
 the application to throw exceptions.
 
 for example when i run a test under RESOURCE_LOCAL, it prints out this two
 sql statements as follows.
 
 1.  TRACE  [main] openjpa.jdbc.SQL - t 1981891711, conn 35138160
 executing prepstmnt 1171248050 SELECT t0.PRSN_ID,
 t1.CUSTOMER_ID,...etc.
 TRACE  [main] openjpa.jdbc.SQL - t 1981891711, conn 35138160 [16 ms]
 spent
 
 2.  ChampAppEJBPU  TRACE  [main] openjpa.jdbc.SQL - t 1981891711, conn
 596825604 executing prepstmnt 1703379623 SELECT t0.INVOICE_ID,
 t0.EST_WAIVER, etc
 
 The same persistence.xml setup on the server using JTA and XA datasource
 only prints out one statement.
 
 TRACE  [main] openjpa.jdbc.SQL - t 1981891711, conn 35138160 executing
 prepstmnt 1171248050 SELECT t0.PRSN_ID,
 t1.CUSTOMER_ID,...etc.
 
 This results in the data from the second sql missing to the application.
 
 clearly something is wrong. I am using WASCE (websphere community edition
 Version 2.1.1.2) and Apache Derby database. Is there something in the JTA
 configuration that i am missing ?
 
 Any thoughts will be appreciated.
 
 
 

-- 
View this message in context: 
http://n2.nabble.com/inconsistent-SQL%27s-RESOURCE_LOCAL-Vrs-JTA-tp3331934p3336665.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.