我定期得到错误:
错误JDBCExceptionReporter - > javax.resource.ResourceException:IJ000453:无法获取java的托管连接:jboss/datasources/myDB 08:12:05,928 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[ default-host].[/ mySoftware].[jsp]](ajp - xx.255.0.yyy-8109-21)Servlet jsp的Servlet.service()抛出异常:javax.resource.ResourceException:IJ000655:没有托管连接在org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.getConnection(SemaphoreArrayListManagedConnectionPool.java:377)等配置的阻塞超时(30000 [ms])内可用.
.
所以,我有下一个数据源配置.在JBoss AS上:
<datasource jta="true" jndi-name="java:jboss/datasources/myDB" pool-name="ssbs-pssbs" enabled="true" use-ccm="true">
<connection-url>jdbc:postgresql://xx.255.0.yyy/myDatabase</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<driver>postgresql-jdbc4</driver>
<pool>
<min-pool-size>30</min-pool-size>
<max-pool-size>150</max-pool-size>
<prefill>true</prefill>
<use-strict-min>false</use-strict-min>
<flush-strategy>FailingConnectionOnly</flush-strategy>
</pool>
<security>
<user-name>tick</user-name>
<password>tack</password>
</security>
<validation>
<check-valid-connection-sql>SELECT 1</check-valid-connection-sql>
<validate-on-match>false</validate-on-match>
<background-validation>false</background-validation>
</validation>
<timeout>
<blocking-timeout-millis>30000</blocking-timeout-millis>
<idle-timeout-minutes>5</idle-timeout-minutes>
</timeout>
<statement>
<share-prepared-statements>false</share-prepared-statements>
</statement>
</datasource>
Run Code Online (Sandbox Code Playgroud)
在我的Postgres服务器上我允许500上的max_connection.为什么我得到这个例外?
我有一个rpt文件,使用它我将生成pdf格式的多个报告.使用inet清除报告中的Engine类.这个过程需要很长时间,因为我要生成近10000个报告.我可以使用Mutli线程或其他方法来加快进程吗?
任何有关如何完成它的帮助都会有所帮助
我的部分代码.
//Loops
Engine eng = new Engine(Engine.EXPORT_PDF);
eng.setReportFile(rpt); //rpt is the report name
if (cn.isClosed() || cn == null ) {
cn = ds.getConnection();
}
eng.setConnection(cn);
System.out.println(" After set connection");
eng.setPrompt(data[i], 0);
ReportProperties repprop = eng.getReportProperties();
repprop.setPaperOrient(ReportProperties.DEFAULT_PAPER_ORIENTATION, ReportProperties.PAPER_FANFOLD_US);
eng.execute();
System.out.println(" After excecute");
try {
PDFExportThread pdfExporter = new PDFExportThread(eng, sFileName, sFilePath);
pdfExporter.execute();
} catch (Exception e) {
e.printStackTrace();
}
Run Code Online (Sandbox Code Playgroud)
PDFExportThread执行
public void execute() throws IOException {
FileOutputStream fos = null;
try {
String FileName = sFileName + "_" …Run Code Online (Sandbox Code Playgroud)