Rick,
I tried closeAll() but still got ora-00604 if the loop times is numberous.
I think it proves it is not an issue of openJPA and I will find the
solution from Oracle JDBC driver or datapase parameters directions.

Anyway, I appreciate your prompt help a lot.

Regards,
Yu Wang



On Tue, Mar 11, 2014 at 11:29 PM, yu wang <wangy...@gmail.com> wrote:

> Rick,
> I believe openjpa does not close the statement promptly OR an oracle
> database jdbc driver issue. It seem if manager is used to create a lot of
> native queries in a loop, the cursors in Oracle database will not be
> released promptly enough. I am using ojdbc6.jar + openjpa-1.2.3.jar.
> Anyway, I will try the cast method. thanks in advance.
>
> Regards,
> Yu Wang
>
>
> On Tue, Mar 11, 2014 at 10:01 PM, Rick Curtis <curti...@gmail.com> wrote:
>
>> No, your question still isn't very clear.
>>
>> > Actually I just want to find a OpenJpa equivalence to close() method of
>> JDBC
>> Statement class
>> I believe that after OpenJPA is done processing a native query we will
>> close the statement. If that isn't happening, you could try to cast your
>> query to an OpenJPAQuery and call .closeAll() on it once you are done
>> using
>> it.
>>
>> Hope this helps.
>> Rick
>>
>>
>> On Tue, Mar 11, 2014 at 5:21 AM, yu wang <wangy...@gmail.com> wrote:
>>
>> > Actually I just want to find a OpenJpa equivalence to close() method of
>> > JDBC Statement class....
>> >
>> >
>> > On Tue, Mar 11, 2014 at 5:56 PM, yu wang <wangy...@gmail.com> wrote:
>> >
>> > > Hi Rick,
>> > > Is my case description clear enough? Any suggestions?
>> > >
>> > > Regards,
>> > > Yu Wang
>> > >
>> > >
>> > > On Sat, Mar 8, 2014 at 3:36 PM, yu wang <wangy...@gmail.com> wrote:
>> > >
>> > >> Hi Rick,
>> > >> I have two very big master/slave tale I made them equal-partitioned
>> by
>> > >> time stamp columns. So when users query something from two tables, I
>> > >> separate the sql into a lot small sql for a lot of very small
>> interval
>> > in a
>> > >> loop to expedite the Execution of the SQL.
>> > >> Then I got "too many cursors" opened error from Oracle. What I am
>> trying
>> > >> to is getting a way to close the cursor explicitly after get its
>> result
>> > >> list.
>> > >>
>> > >> Regards,
>> > >> Yu Wang
>> > >>
>> > >>
>> > >>
>> > >>
>> > >> On Fri, Mar 7, 2014 at 10:00 PM, Rick Curtis <curti...@gmail.com>
>> > wrote:
>> > >>
>> > >>> You're going to have to give a better description of your scenario
>> for
>> > us
>> > >>> to help you.
>> > >>>
>> > >>> Thanks,
>> > >>> Rick
>> > >>>
>> > >>>
>> > >>> On Fri, Mar 7, 2014 at 3:37 AM, yu wang <wangy...@gmail.com> wrote:
>> > >>>
>> > >>> > Hi Gurus,
>> > >>> > I have manager.createNativeQuery() in a loop eventually lead to
>> > Oracle
>> > >>> > error:
>> > >>> > ORA-00604 and ORA-01000, which means cursors open in the oracle
>> > exceed
>> > >>> the
>> > >>> > maximum.
>> > >>> >
>> > >>> > My question is how can I close some cursors explicitly in a loop?
>> I
>> > try
>> > >>> > manager.clear() but seems it does not work.
>> > >>> >
>> > >>> > We are using OpenJPA 1.2.3.
>> > >>> >
>> > >>> > Regards,
>> > >>> > Yu Wang
>> > >>> >
>> > >>>
>> > >>>
>> > >>>
>> > >>> --
>> > >>> *Rick Curtis*
>> > >>>
>> > >>
>> > >>
>> > >
>> >
>>
>>
>>
>> --
>> *Rick Curtis*
>>
>
>

Reply via email to