• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Statement object

 
Leandro Oliveira
Ranch Hand
Posts: 298
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using massivelly an object of type java.sql.Statement to execute an update, then a query, then another 2 updates and finally 1 query... 30% of times I execute the code I have the following exception
java.sql.SQLException: Exce��o de E/S: Socket closed
Please, could someone help me, I cannot figure out what is happening.... when does this exception ocurrs??? it is happening at a method in my oracle driver...

thanks in advance!!!
 
Chris Brat
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I also had some strange exceptions when I used only one Statement object - I've changed over to using different Statmenet objs for selection and update operations.
This has sorted out my problems but of course I dont know if this is a best practice (overheads of creating new objects?!?)
 
Leandro Oliveira
Ranch Hand
Posts: 298
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm doing the same since some time ago I changed the statement objects for selections and updates but it is not working....
 
Leandro Oliveira
Ranch Hand
Posts: 298
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Part of the stack trace:

java.sql.SQLException: Exce��o de E/S: Socket closed
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333)
at oracle.jdbc.driver.OracleStatement.(OracleStatement.java:389)
at oracle.jdbc.driver.OracleConnection.privateCreateStatement(OracleConnection.java:772)
at oracle.jdbc.driver.OracleConnection.createStatement(OracleConnection.java:712)
 
Leandro Oliveira
Ranch Hand
Posts: 298
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi people!! I'm here to state that I solved the problem and how I solved it...
In my application we have two pools, one of them, is a really poor pool, so I decided to add more functionality to this pool, but since the differences would break compatibility I created another class, and since time isn't enouth I decided to take part of the application using the new pool, and other part of the application using the older pool. Since they are different each would manage different connections and there would be at least 2 connections. Aware of that I keept programing. For some reason each of them were affecting the others connection (I'm not so sure of this) and when I tried to create a statement object, I had some problems... sometimes....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic