Win a copy of Android Programming: The Big Nerd Ranch Guide this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

multiple threads for database  RSS feed

 
Steve Jiang
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I changed a process to multiple threads to read data from DB. the original code works fine. I just change main process to multiple threads with DBPool and keep all DB code without change.

after changed to multiple thread, it throws SQLException as

java.sql.SQLException: ORA-01001: invalid cursor

and
java.sql.SQLException: Closed Statement: next

Any advices for the change for multiple threads DB access?

Thanks,
[ September 09, 2005: Message edited by: Steve Jiang ]
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use only local variables for thread-safety.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!