• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ORA 01001 : Invalid Cursor

 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello there!
I have a query that returns a large amount of data (please don't throw any rocks at me, I really have some reasons for this query although I do not agree with them). The query is very simple:
SELECT email from USERS; single column, indexed on Oracle 10g.
Problem is: 1.98 million results.
Well, running this query using a tool like SquirrelSQL (pure java) it does run (ok, I dunno what kind of parameters it use to maybe limit the size of the query return)
But truth is, when I run this (I'm using Spring with JDBC here), as soon as I hit: rs.next(); I get this exception.
Is there a way to avoid this? I've checked Oracle's docs and it says that it's caused because there's too many opened cursors. I'm stupid on this, but a single connection has more than one cursor?

Any ideas on how can I fetch such huge amount of data?
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Vinicius,
Are you closing the connection/statement/resultset when you are done with it? Maybe cursors are open from the previous query?

I suggest doing some experimentation to see when you are hitting this problem. You could always do this query in multiple shots (all e-mail beginning with A, B, C, ... to limit results.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Vinicius Carvalho:
Hello there!
I have a query that returns a large amount of data (please don't throw any rocks at me, I really have some reasons for this query although I do not agree with them). The query is very simple:
SELECT email from USERS; single column, indexed on Oracle 10g.
Problem is: 1.98 million results.
Well, running this query using a tool like SquirrelSQL (pure java) it does run (ok, I dunno what kind of parameters it use to maybe limit the size of the query return)
But truth is, when I run this (I'm using Spring with JDBC here), as soon as I hit: rs.next(); I get this exception.
Is there a way to avoid this? I've checked Oracle's docs and it says that it's caused because there's too many opened cursors. I'm stupid on this, but a single connection has more than one cursor?

Any ideas on how can I fetch such huge amount of data?




well first of all increase ur table space.
1 drop table space
2 increase tablespace
3 refer oracle 9i doc
 
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

as soon as I hit: rs.next(); I get this exception.



Sounds like the sql failed to execute and the recordset is not in a valid state. Is there a previous exception thrown that is being supressed? Possibly from the execute? Or is there another exception chained to this one?

That exception may give more information as to what caused the problem.
 
You get good luck from rubbing the belly of a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic