-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 posts ] 
Author Message
 Post subject: ORA:01002 fetch out of sequence in Weblogic8.1
PostPosted: Sat Nov 08, 2003 10:27 am 
Newbie

Joined: Thu Sep 04, 2003 10:27 pm
Posts: 3
I'm trying to deploy our application from Tomcat 4.1.17 to Weblogic8.1sp1.

If I do NOT use Weblogic Connection Pools all things went OK.

When I follow the indicate from the FAQ(using a startup class) I got a problem:

When I try to insert a record into the database(We use Oracle8.1.7), the exception is "ORA:01002 fetch out of sequence"

I searched in the Internet. In www.weblogic.com it says the problem is due to the oracle8.1 in NT.

But if I use Hibernate connection pool to connect to the Oracle8.1.7 I did NOT get any problem(both in Tomcat and Weblogic).

It seems there is some problem when using Weblogic8.1 together with Oracle8.1.7 and Hibernate2.0.3

If u have successfully depoly some application using Hibernate and Oracle8.1 to Weblogic8.1 plz tell me the details should be noticed.

Thanks!


Top
 Profile  
 
 Post subject: I partly solved it
PostPosted: Tue Nov 11, 2003 11:03 am 
Newbie

Joined: Thu Sep 04, 2003 10:27 pm
Posts: 3
there is a problem between weblogic8.1 and oracle8.1.7 jdbc driver with "autocommit is true".
but I could not find the place to set the DataSource's autocommit property to false in weblogic:( , so we changed the code of Hibernate2.0.3 to set autocommit to false hardly.
And now the "fetch out of sequence" is solved.


Top
 Profile  
 
 Post subject: Re: I partly solved it
PostPosted: Thu Dec 23, 2004 8:38 pm 
Senior
Senior

Joined: Wed Dec 17, 2003 4:24 am
Posts: 188
zheng wrote:
there is a problem between weblogic8.1 and oracle8.1.7 jdbc driver with "autocommit is true".
but I could not find the place to set the DataSource's autocommit property to false in weblogic:( , so we changed the code of Hibernate2.0.3 to set autocommit to false hardly.
And now the "fetch out of sequence" is solved.


Have you find any solution? I couldn't find "autocommit" in any config file in JBoss and Hibernate. If you found it and saw this topic,please help!

_________________
You are not alone...


Top
 Profile  
 
 Post subject: Re: I partly solved it
PostPosted: Fri Dec 24, 2004 9:37 am 
Contributor
Contributor

Joined: Thu Nov 06, 2003 9:49 pm
Posts: 104
Location: New York, NY
Yashnoo wrote:
zheng wrote:
there is a problem between weblogic8.1 and oracle8.1.7 jdbc driver with "autocommit is true".
but I could not find the place to set the DataSource's autocommit property to false in weblogic:( , so we changed the code of Hibernate2.0.3 to set autocommit to false hardly.
And now the "fetch out of sequence" is solved.


Have you find any solution? I couldn't find "autocommit" in any config file in JBoss and Hibernate. If you found it and saw this topic,please help!


Weblogic's JDBC connection pool definition (in config.xml) allows you to pass properties to the underlying JDBC driver, which should allow you to control this. The Weblogic connection pooler might not disable autocommit in some cases. Or, perhaps you have inadvertently configured the connection pool to enable autocommit (not good).

You may want to check your JDBCConnectionPool configuration:
http://e-docs.bea.com/wls/docs81/config ... tml#435804

or, if you are using the new(ish) 'application level pools':

http://e-docs.bea.com/wls/docs81/progra ... coped-pool

That said, I've been using the ORACLE thin JDBC driver (8i) and the Weblogic connection pooler for years (WL 5.1, 6.1 and now 8.1sp3) now with no problems. The code that uses the connection pool includes Hibernate, 'straight' JDBC, and TOPLink.


Top
 Profile  
 
 Post subject: Re: I partly solved it
PostPosted: Sat Dec 25, 2004 6:17 am 
Senior
Senior

Joined: Wed Dec 17, 2003 4:24 am
Posts: 188
jdavis wrote:
Yashnoo wrote:
zheng wrote:
there is a problem between weblogic8.1 and oracle8.1.7 jdbc driver with "autocommit is true".
but I could not find the place to set the DataSource's autocommit property to false in weblogic:( , so we changed the code of Hibernate2.0.3 to set autocommit to false hardly.
And now the "fetch out of sequence" is solved.


Have you find any solution? I couldn't find "autocommit" in any config file in JBoss and Hibernate. If you found it and saw this topic,please help!


Weblogic's JDBC connection pool definition (in config.xml) allows you to pass properties to the underlying JDBC driver, which should allow you to control this. The Weblogic connection pooler might not disable autocommit in some cases. Or, perhaps you have inadvertently configured the connection pool to enable autocommit (not good).

You may want to check your JDBCConnectionPool configuration:
http://e-docs.bea.com/wls/docs81/config ... tml#435804

or, if you are using the new(ish) 'application level pools':

http://e-docs.bea.com/wls/docs81/progra ... coped-pool

That said, I've been using the ORACLE thin JDBC driver (8i) and the Weblogic connection pooler for years (WL 5.1, 6.1 and now 8.1sp3) now with no problems. The code that uses the connection pool includes Hibernate, 'straight' JDBC, and TOPLink.


Do you use hilo in JTA environment? I find the answer in Hibernate & JBoss Forum,emmanuel say:
Quote:
As per the doc hilo must not be used with connections enlisted with JTA or with a user-supplied connection


I also see hibernate docs. It can't be use in JTA. But the problem is that if I config oracle datasource in JBoss config file,it means that I already use it in JTA?

_________________
You are not alone...


Top
 Profile  
 
 Post subject: Re: I partly solved it
PostPosted: Sat Dec 25, 2004 10:01 pm 
Contributor
Contributor

Joined: Thu Nov 06, 2003 9:49 pm
Posts: 104
Location: New York, NY
Yashnoo wrote:
Do you use hilo in JTA environment?


No, because that requires a separate transaction to obtain the high value from the table (as it says in the docos). I find it's best to use the 'native' ID generator, which does what a DBA might expect (sequence in ORACLE, identity column in SQL Server, etc.).

Yashnoo wrote:
I also see hibernate docs. It can't be use in JTA. But the problem is that if I config oracle datasource in JBoss config file,it means that I already use it in JTA?


Well... JBoss being as configurable as it is, I wouldn't be surprised if there was a way to configure a JDBC data source *without* transaction support, but I've never had the need to do that. If you don't need JTA, EJBs or anything like that then why bother using a full app server like JBoss?


Top
 Profile  
 
 Post subject: :)
PostPosted: Sun Jan 02, 2005 5:16 am 
Senior
Senior

Joined: Wed Dec 17, 2003 4:24 am
Posts: 188
Thank you jdavis.

You mean that I already configure a JDBC data source with transaction support? Because I use JBoss and I configure hibernate to oracle-service.xml.

Now , I change the id generator to sequence. It work fine. :)
But sequence dependent special database. ;-(

_________________
You are not alone...


Top
 Profile  
 
 Post subject: Re: :)
PostPosted: Sun Jan 02, 2005 10:13 am 
Contributor
Contributor

Joined: Thu Nov 06, 2003 9:49 pm
Posts: 104
Location: New York, NY
Yashnoo wrote:
Thank you jdavis.

You mean that I already configure a JDBC data source with transaction support? Because I use JBoss and I configure hibernate to oracle-service.xml.


I'm not what you mean by that. I was saying that hilo requires a separate transaction to update the hilo table. In JTA, the JDBC data source will participate in the current transaction unless you have transactions turned off.

Yashnoo wrote:
Now , I change the id generator to sequence. It work fine. :)
But sequence dependent special database. ;-(


Use the 'native' id generator if you want Hibernate to pick a scheme that works with the database you have. The extra parameter will be ignored for databases that do not have sequences.

You really ought to read the documentation, it describes all of this quite nicely:
http://www.hibernate.org/hib_docs/refer ... -generator


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.