2016-08-12 55 views
0

我正在一個java項目中,我們使用oracle作爲數據庫,我們有兩個模式,用於我們在連接池中創建saprate連接的每個模式。java.sql.SQLException:ORA-00942:表或視圖不存在,每第三次訪問數據庫

它的工作正常,如果我們從客戶端一次從表中獲取最大2個請求的數據,但每隔三次獲得java.sql.SQLException: ORA-00942: table or view does not exist例外。

我想了解爲什麼它的發生和可能的原因是什麼?請幫幫我。

完整堆棧跟蹤:

java.sql.SQLException: ORA-00942: table or view does not exist 
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:111) 
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:330) 
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:287) 
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:742) 
    at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:212) 
    at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:795) 
    at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1030) 
    at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:835) 
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1123) 
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3284) 
    at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3328) 
    at DLRecordSetSQL.DLRecordSetSQL.setRecordCount(DLRecordSetSQL.java:3622) 
    at DLRecordSetSQL.DLRecordSetSQL.open(DLRecordSetSQL.java:3124) 
    at DLRecordSetSQL.DLRecordSetSQL.open(DLRecordSetSQL.java:3207) 
    at com.utility.queryManager.util.MetadataManager.init(MetadataManager.java:79) 
    at com.utility.queryManager.util.MetadataManager.<init>(MetadataManager.java:65) 
    at com.utility.queryManager.processor.UtilityManagerRequestProcessor.selectCommandRequestProcessor(UtilityManagerRequestProcessor.java:187) 
    at com.utility.queryManager.processor.UtilityManagerRequestProcessor.UtilityRequestProcessor(UtilityManagerRequestProcessor.java:77) 
    at com.utility.queryManager.servlet.UtilityManagerServlet.doPost(UtilityManagerServlet.java:36) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:641) 
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) 
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240) 
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164) 
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462) 
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164) 
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) 
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563) 
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) 
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:399) 
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:317) 
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:204) 
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:311) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) 
    at java.lang.Thread.run(Thread.java:662) 
+0

你可以給更多的細節,腳本? –

+0

也許您的連接在連接池中混淆,並且您正在訪問錯誤的模式? –

回答

1

我覺得你的數據庫被耗盡可用的連接。

您可以設置的初始池大小5.因爲它是默認爲0。

欲瞭解更多,您可以通過這個教程中去:Setting Connection Pool Properties in Oracle

由於Avi stated問題如下

Oracle數據庫連接不是多線程的。如果兩個或多個線程同時嘗試訪問相同的連接,則其中一個 將阻塞,直到另一個線程完成與連接的交互。

所以我想你應該嘗試驗證你的代碼是否表現出這種 行爲試圖同時從多個線程訪問同一個數據庫連接。

-1

表在兩個數據庫請求後刪除,這是問題,請重新檢查你的代碼或數據庫設定

+0

感謝您的回答,但第三次打擊後,如果我再次從客戶端打到數據庫,然後再次獲得數據,我的意思是異常正在進入3,6,9 ...擊中 –

相關問題