精华内容
下载资源
问答
  • public classPooledDataSource implements DataSource {private static final Log log = ...//PollState 充当锁对象,这个对象中也有例如 空闲连接集合,活跃链接集合,请求的数量,等一些变量private final PoolSta...

    public classPooledDataSource implements DataSource {private static final Log log = LogFactory.getLog(PooledDataSource.class);

    //PollState 充当锁对象,这个对象中也有例如 空闲连接集合,活跃链接集合,请求的数量,等一些变量private final PoolState state = new PoolState(this);

    //PolledDataSource中的数据源也是使用的UnpolledDataSource对象来实现的privatefinal UnpooledDataSource dataSource;//OPTIONAL CONFIGURATION FIELDS 线程池的最大活跃数量,最大空闲数量,等待时间等等。。。

    protected int poolMaximumActiveConnections = 10;protected int poolMaximumIdleConnections = 5;protected int poolMaximumCheckoutTime = 20000;protected int poolTimeToWait = 20000;protected int poolMaximumLocalBadConnectionTolerance = 3;protected String poolPingQuery = "NO PING QUERY SET";protectedboolean poolPingEnabled;protected intpoolPingConnectionsNotUsedFor;

    //url+username+password连接起来的字符串的hashcode值private intexpectedConnectionTypeCode;publicPooledDataSource() {

    dataSource= newUnpooledDataSource();

    }publicPooledDataSource(UnpooledDataSource dataSource) {this.dataSource =dataSource;

    }publicPooledDataSource(String driver, String url, String username, String password) {

    dataSource= newUnpooledDataSource(driver, url, username, password); expectedConnectionTypeCode=assembleConnectionTypeCode(dataSource.getUrl(), dataSource.getUsername(), dataSource.getPassword());

    }

    //获取连接connection

    @OverridepublicConnection getConnection() throws SQLException {returnpopConnection(dataSource.getUsername(), dataSource.getPassword()).getProxyConnection();

    }

    @OverridepublicConnection getConnection(String username, String password) throws SQLException {returnpopConnection(username, password).getProxyConnection();

    }

    //线程安全的获取连接的方法(供PooledConnection中调用) synchronizedprotected voidpushConnection(PooledConnection conn) throws SQLException {

    //所对象为PoolState

    synchronized (state) {

    state.activeConnections.remove(conn);if(conn.isValid()) {if (state.idleConnections.size() < poolMaximumIdleConnections && conn.getConnectionTypeCode() ==expectedConnectionTypeCode) {

    state.accumulatedCheckoutTime+=conn.getCheckoutTime();if (!conn.getRealConnection().getAutoCommit()) {

    conn.getRealConnection().rollback();

    }

    PooledConnection newConn= new PooledConnection(conn.getRealConnection(), this);

    state.idleConnections.add(newConn);

    newConn.setCreatedTimestamp(conn.getCreatedTimestamp());

    newConn.setLastUsedTimestamp(conn.getLastUsedTimestamp());

    conn.invalidate();if(log.isDebugEnabled()) {

    log.debug("Returned connection" + newConn.getRealHashCode() + "to pool.");

    }

    state.notifyAll();

    }else{

    state.accumulatedCheckoutTime+=conn.getCheckoutTime();if (!conn.getRealConnection().getAutoCommit()) {

    conn.getRealConnection().rollback();

    }

    conn.getRealConnection().close();if(log.isDebugEnabled()) {

    log.debug("Closed connection" + conn.getRealHashCode() + ".");

    }

    conn.invalidate();

    }

    }else{if(log.isDebugEnabled()) {

    log.debug("A bad connection (" + conn.getRealHashCode() + ") attempted to return to the pool, discarding connection.");

    }

    state.badConnectionCount++;

    }

    }

    }privatePooledConnection popConnection(String username, String password) throws SQLException {

    boolean countedWait= false;

    PooledConnection conn= null;long t =System.currentTimeMillis();int localBadConnectionCount = 0;while (conn == null) {

    synchronized (state) {

    //如果state中空闲的连接不为空时,直接从state中的idelConnections集合中获取if (!state.idleConnections.isEmpty()) {//Pool has available connection

    conn = state.idleConnections.remove(0);if(log.isDebugEnabled()) {

    log.debug("Checked out connection" + conn.getRealHashCode() + "from pool.");

    }

    }else{

    //state中的idelConnections集合中没有连接connection了,判断活跃的connection是否小于最大活跃线程数,小于的话就新建一个connection//Pool does not have available connection

    if (state.activeConnections.size()

    conn = new PooledConnection(dataSource.getConnection(), this);if(log.isDebugEnabled()) {

    log.debug("Created connection" + conn.getRealHashCode() + ".");

    }

    }else{

    //当前活跃的connection数大于最大活跃connection数是,表明不能新建connection,这种情况下,会判断是否已经超过设定的时间20s,如果超过,会根据是否自动commit,

    /不是自动提交,会进行rollback操作//Cannot create new connection

    PooledConnection oldestActiveConnection = state.activeConnections.get(0);long longestCheckoutTime =oldestActiveConnection.getCheckoutTime();if (longestCheckoutTime >poolMaximumCheckoutTime) {//判断是否超时//Can claim overdue connection

    state.claimedOverdueConnectionCount++;

    state.accumulatedCheckoutTimeOfOverdueConnections+=longestCheckoutTime;

    state.accumulatedCheckoutTime+=longestCheckoutTime;

    state.activeConnections.remove(oldestActiveConnection);if (!oldestActiveConnection.getRealConnection().getAutoCommit()) {//判断是否设置了自动提交,不是自动提交的话,会进行rollbacktry{

    oldestActiveConnection.getRealConnection().rollback();

    }catch(SQLException e) {/*Just log a message for debug and continue to execute the following

    statement like nothing happend.

    Wrap the bad connection with a new PooledConnection, this will help

    to not intterupt current executing thread and give current thread a

    chance to join the next competion for another valid/good database

    connection. At the end of this loop, bad {@link @conn} will be set as null.*/log.debug("Bad connection. Could not roll back");

    }

    }

    //将之前rollback的connection进行处理,重新生成一个connection,并设置创建时间和最后使用时间

    conn= new PooledConnection(oldestActiveConnection.getRealConnection(), this);

    conn.setCreatedTimestamp(oldestActiveConnection.getCreatedTimestamp());

    conn.setLastUsedTimestamp(oldestActiveConnection.getLastUsedTimestamp());

    oldestActiveConnection.invalidate();if(log.isDebugEnabled()) {

    log.debug("Claimed overdue connection" + conn.getRealHashCode() + ".");

    }

    }else{

    //当活跃connection的集合中第一个connection不符合超时,则进行等待wait//Must wait

    try{if (!countedWait) {

    state.hadToWaitCount++;

    countedWait= true;

    }

    //pooltimeTowait默认也是20秒if(log.isDebugEnabled()) {

    log.debug("Waiting as long as" + poolTimeToWait + "milliseconds for connection.");

    }long wt =System.currentTimeMillis();

    state.wait(poolTimeToWait);

    state.accumulatedWaitTime+= System.currentTimeMillis() -wt;

    }catch(InterruptedException e) {break;

    }

    }

    }

    }

    //经过以上处理,如果conn仍然没有值,则会循环走一行流程,第二次一定会获取到conn对象(默认的超时时间是20秒,第一次已经等待过20s了)if (conn != null) {

    //判断conn是否能用 通过ping能否ping通//ping to server and check the connection is valid or not

    if(conn.isValid()) {if (!conn.getRealConnection().getAutoCommit()) {

    conn.getRealConnection().rollback();

    }

    conn.setConnectionTypeCode(assembleConnectionTypeCode(dataSource.getUrl(), username, password));

    conn.setCheckoutTimestamp(System.currentTimeMillis());

    conn.setLastUsedTimestamp(System.currentTimeMillis());

    state.activeConnections.add(conn);

    state.requestCount++;

    state.accumulatedRequestTime+= System.currentTimeMillis() -t;

    }else{if(log.isDebugEnabled()) {

    log.debug("A bad connection (" + conn.getRealHashCode() + ") was returned from the pool, getting another connection.");

    }

    state.badConnectionCount++;

    localBadConnectionCount++;

    conn= null;if (localBadConnectionCount > (poolMaximumIdleConnections +poolMaximumLocalBadConnectionTolerance)) {if(log.isDebugEnabled()) {

    log.debug("PooledDataSource: Could not get a good connection to the database.");

    }throw new SQLException("PooledDataSource: Could not get a good connection to the database.");

    }

    }

    }

    }

    }if (conn == null) {if(log.isDebugEnabled()) {

    log.debug("PooledDataSource: Unknown severe error condition. The connection pool returned a null connection.");

    }throw new SQLException("PooledDataSource: Unknown severe error condition. The connection pool returned a null connection.");

    }returnconn;

    }}

    展开全文
  • 今天发现了这个问题,数据源连接池的配置方式dbcp c3p0 Druid 然后百度得到了第一个答案C3P0官方对于MySQL8小时问题的解决方案 The last packet successfully received from the server was x milliseconds ago ...

    今天发现了这个问题,数据源连接池的配置方式dbcp c3p0 Druid

    然后百度得到了第一个答案C3P0官方对于MySQL8小时问题的解决方案 The last packet successfully received from the server was x milliseconds ago

    由此牵扯出这三种数据源的配置方式与区别。

    严重: Servlet.service() for servlet [springmvc] in context with path [/ConfigTest] threw exception [Request processing failed; nested exception is org.springframework.dao.RecoverableDataAccessException: 
    ### Error querying database.  Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 104,082,342 milliseconds ago.  The last packet sent successfully to the server was 104,082,342 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
    ### The error may exist in file [D:\apache-tomcat-8.5.35\webapps\ConfigTest\WEB-INF\classes\me\turnforget\mapping\userMap.xml]
    ### The error may involve user.findUser-Inline
    ### The error occurred while setting parameters
    ### SQL: select * from blog_users where user_name=? and user_password=?
    ### Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 104,082,342 milliseconds ago.  The last packet sent successfully to the server was 104,082,342 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
    ; SQL []; The last packet successfully received from the server was 104,082,342 milliseconds ago.  The last packet sent successfully to the server was 104,082,342 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 104,082,342 milliseconds ago.  The last packet sent successfully to the server was 104,082,342 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.] with root cause
    java.net.SocketException: Software caused connection abort: socket write error
        at java.net.SocketOutputStream.socketWrite0(Native Method)
        at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:111)
        at java.net.SocketOutputStream.write(SocketOutputStream.java:155)
        at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
        at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
        at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3725)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2506)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2677)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2549)
        at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861)
        at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1192)
        at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172)
        at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172)
        at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:59)
        at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:73)
        at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:60)
        at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:267)
        at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:137)
        at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:96)
        at com.github.pagehelper.PageInterceptor.intercept(PageInterceptor.java:141)
        at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:60)
        at com.sun.proxy.$Proxy28.query(Unknown Source)
        at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:108)
        at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:102)
        at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:66)
        at sun.reflect.GeneratedMethodAccessor79.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:355)
        at com.sun.proxy.$Proxy21.selectOne(Unknown Source)
        at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:160)
        at me.turnforget.dao.impl.UserDaoImpl.findUser(UserDaoImpl.java:29)
        at me.turnforget.service.impl.UserServiceImpl.findUser(UserServiceImpl.java:25)
        at me.turnforget.controller.UserController.login(UserController.java:96)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
        at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)
        at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:832)
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:743)
        at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:961)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:895)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967)
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:869)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
        at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
        at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
        at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)
        at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
        at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
        at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:748)
     

    展开全文
  • Websphere 命令行配置DB2数据源连接池

    千次阅读 2011-01-11 16:30:00
     WAS ND的数据源连接池在控制台中很好配置,同样通过命令行也可以配置,WAS支持两种语法,Jacl与Jython,个人更喜欢Jython,Jython语法中不用分号结尾,下面是Jython语法的命令行数据源配置:  1)进入...

          WAS ND的数据源连接池在控制台中很好配置,同样通过命令行也可以配置,WAS支持两种语法,Jacl与Jython,个人更喜欢Jython,Jython语法中不用分号结尾,下面是Jython语法的命令行数据源配置:

          1)进入WAS安装目录/bin中,执行./wsadmin -user 用户名 -password 密码 -lang jython启动WAS命令行控制台,所有的配置均可以在这里完成,前提是WAS Node启动。

          2)首先创建JDBCProvider

                domain = AdminConfig.getid('/Cell:cellname/Node:nodename/')    /*可以通过print provider查看是否成功创建 ,Cell=AdminControl.getCell()   Node=AdminControl.getNode()*/

     

                classpath = ['classpath', 'jar包位置:jar包位置....']

     

                name = ['name', 'GlobalJDBCProvider']

     

                implCN = ['implementationClassName', 'com.ibm.db2.jcc.DB2ConnectionPoolDataSource']

     

                providerType = ['providerType', 'DB2 Universal JDBC Driver Provider']

     

                providerAttrs = [classpath, name, implCN, providerType]

     

                AdminConfig.create('JDBCProvider', domain , providerAttrs)

     

                AdminConfig.save()

     

                创建完成并保存后,可以在集成控制台中看到

     

          3)创建J2CAuthentation

     

                security = AdminConfig.getid('/Cell:cellname/Security:/')

     

                alias = ['alias', 'alias']

     

                userid = ['userId', 'userId']

     

                password = ['password', 'password']

     

                securityAttrs = [alias, userid, password]

     

                AdminConfig.create('JAASAuthData', security, securityAttrs)

     

                AdminConfig.save()

     

                创建完成并保存后,可以在集成控制台中看到

     

          4)创建DataSource

     

                ds = AdminConfig.getid('/Cell:cellname/Node:nodename/JDBCProvider:jdbcprovidername/')

     

                adas = ['authDataAlias', 'alias'] 与上一步中的alias对应

     

                dhc = ['datasourceHelperClassname', 'com.ibm.websphere.rsadapter.DB2UniversalDataStoreHelper']

     

                jndiName = ['jndiName', 'jndiName']

     

                name = ['name', 'name']

     

                dsAttrs = [adas, dhc, jndiName, name]

     

                AdminConfig.create('DataSource', ds, dsAttrs)

     

                AdminConfig.save()

     

                创建完成并保存后,可以在集成控制台中看到

     

          5)配置DataSource连接的DB信息

    ds = AdminConfig.getid('/Cell:cellname/Node:nodename/JDBCProvider:jdbcprovidername/DataSource:ds/')

     

                jps = AdminConfig.create('J2EEResourcePropertySet', ds, [])

     

                databaseName = [['name', 'databaseName'], ['value', 'databaseName']]

     

                driverType = [['name', 'driverType'], ['value', '4']]

     

                serverName = [['name', 'serverName'], ['value', 'hostname']]

     

                portNumber = [['name', 'portNumber'], ['value', 'portNumber']]

     

                AdminConfig.create('J2EEResourceProperty', jps, databaseName)

     

                AdminConfig.create('J2EEResourceProperty', jps, driverType)

     

                AdminConfig.create('J2EEResourceProperty', jps, serverName)

     

                AdminConfig.create('J2EEResourceProperty', jps, portNumber)

     

                AdminConfig.save()

     

                创建完成并保存后,可以在集成控制台中看到

     

          6)创建ConnectionPool

     

                AdminConfig.create('ConnectionPool', ds, [['maxConnections','10']])

     

                AdminConfig.save()

     

                创建完成并保存后,可以在集成控制台中看到

     

          7)测试连接

     

                AdminControl.testConnection(ds)

     

          至此,数据源配置完成

     

     

     

     

     

     

     

    展开全文
  • WAS 数据源配置文件位置

    千次阅读 2020-07-19 13:10:42
    上周查了个问题:WAS启动卡在连接池初始化上,明显是数据源配置问题。 因为WAS起不来,所以进控制台排查肯定是不行了,好在服务器本地数据源配置是明文。 该配置在$WAS_HOME/***/PROFILE_NAME/config/***/resource...

    上周查了个问题:WAS启动卡在连接池初始化上,明显是数据源配置问题。

    因为WAS起不来,所以进控制台排查肯定是不行了,好在服务器本地数据源配置是明文。

    该配置在 $WAS_HOME/***/PROFILE_NAME/config/***/resource.xml 下,中间省略若干路径,可以用find函数查询文件名确定。

    一般说来,resource.xml文件在 profile或者node或者server文件夹下各有一份,要仔细查看确认内容,才能找到实际使用的那个。

    展开全文
  • 1:DBCP数据源DBCP类包位于/lib/jakarta-commons/commons-dbcp.jar,DBCP是一个依赖Jakartacommons-pool对象池机制的数据库连接池,所以在类路径下还必须包括/lib/jakarta-commons/commons-pool.jar。下面是使用DBCP...
  • 在 Liberty 概要文件中配置数据库连接可以为数据库连接配置与不同 JDBC 提供程序相关联的数据源。JDBC 提供程序提供与特定供应商数据库进行 JDBC 连接所需...它并不提供互操作性来增强连接池,而且不能作为具备两阶...
  • 如果WebSphere使用数据源连接 数据库尤其是oracle的时候出现错误:连接池管理器无法分配一个受管连接:javax.resource.spi.ResourceAllocationException: DSRA0080E: An exception was received by the Data Store ...
  • 转:WAS配置数据源

    2010-01-27 15:10:29
    基本介绍: 通过WebSphere配置数据库连接池一共需要三项: 1....配置数据库连接池,在这里叫:配置数据源; 提供jndi名称 3.配置数据库登录帐号,密码,在这里叫:J2C认证别名; ==========================...
  • ssh数据源(c3p0+was

    2013-10-29 20:21:00
    ssh web 应用使用c3p0数据库连接池 ibm 给出的实例说明 将ssh web应用程序从tomcat迁移到websphere(was) WAS数据源的配置使用及其常见问题 开源DBCP、C3P0、Proxool 、 BoneCP连接池的比较 ...
  • 项目DBCP配置内容如下###### DBCP连接池参数配置 ###### #######jdbc连接池初始连接数,设置后更好发挥连接池左右jdbc.initialSize=10#jdbc最大活动连接数,即连接池上限,要小于数据库连接上限,项目组根...
  • 企业应用一般都需要连接数据库,自从有了应用服务器之后,应用连接数据库就可以利用数据库连接池的方式来提高性能。基于J2EE的WEB应用一般是通过JDBC的方式来访问数据库,而且大部分都是通过数据源的方式来得到...
  • 目录 WAS安装过程 1验证安装 12HttpServer安装 14验证安装 17Plugin安装 19验证安装 25如何在WAS6.0下配置数据源 27如何配置环境变量 31定制用户注册表 32使用自定义文...
  • 文章转自:...基于J2EE的WEB应用一般是通过JDBC的方式来访问数据库,而且大部分都是通过数据源的方式来得到数据库连接的。WebSphere应用服务器(WAS)自从3.5版本便开始支持JDBC2.0,并支持用JNDI的方式
  • tomcat数据源配置DBCP

    2018-10-10 15:35:00
    原文件: ... DBCP object created 日期 by the following code was ... 看到标题 DBCP 首先想到的肯定是 数据库连接池哪方面有问题,那么先别着急去解决,不要一股脑就钻进逻辑代码中,然后启用调试就开始一步一步 ...
  • --============================配置数据源=================================--> destroy-method=\"close\"> ${driverClass}\"/> ${jdbcurl}\"/> ${jdbcusername}\"/> ${jdbcpassword}\"/> <!-- ...
  • (1)关于was数据源连接池的最大、最小配置多大合适?怎样去计算? (2)关于JVM的配置,64位系统,64位WAS,最值小和最大配置多大最优?怎样去计算? (3)应用服务器线程池,怎么样配置最优? 怎样去计算...
  • WAS日常性能检测

    2012-08-10 08:44:14
    数据源连接池、JVM内存占用、WebContainer线程池数量等监控
  • WAS上设置超时时间 增大was与数据库的连接池 修改WebContainer was控制台上创建数据源
  • web中间件切换(was切tomcat)

    千次阅读 2015-03-10 17:31:28
    一、数据源迁移: ①数据源配置在web容器还是在项目本身? ... ...原先was数据源直接在console控制,密码是密文,较...方案有两个:一是继承连接池工厂类BasicDataSourceFactory并重写一些方法;二是直接修改BasicDataSo
  • WAS服务器参数配置

    2018-12-17 17:21:41
    websphere参数必须要结合运行环境的实际情况来调整,例如Web Container的线程池大小、数据源连接池大小、语句高速缓存大小(Prepared statement cache size),这几项参数都很重要,要结合实际的并发量和服务器的资源...
  • WAS常用修改 JVM设置 jvm大小设置: 数据源设置 连接池大小: 连接高速缓冲大小: WebContainer设置
  • WAS重新部署后无法正常启动

    千次阅读 2015-03-03 14:15:24
    今天上午在WAS6上重新部署项目,结果把最新的提交上去之后,WAS无法启动也无法...项目用的SSH,在本机测试的时候hibernate数据源连接池用的C3P0,在WAS上应该用是JNDI。当数据源配置为C3P0,WAS启动初始化数据源失败而
  • mysql的配置已经加上了。没配多数据源前一切正常,配置多数据源后,长时间不操作,第二天重新请求报错,求各位...#连接池空闲连接的有效时间 ,设置30分钟 spring.datasource.min-evictable-idle-time-millis=1800000
  • WAS & IHS 优化

    千次阅读 2013-08-21 20:24:43
    WAS配置概要  描述 参数 缺省值 设置原则 JVM堆栈 服务器 > 应用程序服务器 > server1 > Java 虚拟机 无 最小值为总内存1/8,最大...连接池 ... > 数据源> (数据源
  • 配置数据库连接池,在这里叫:配置数据源; 3.配置数据库登录帐号,密码,在这里叫:J2C认证别名; 1.1 启动服务器,通过IE浏览器输入http://127.0.0.1:9060/ibm/console进入websphere控制台目录 1.2 单击左边资源==》在...
  • 生产环境系统有4个数据源,主数据源用的mybatis,连接池应该是druid,其他3个数据源用的是cp30,发现初始化连接池时好慢,不过之后就正常了,系统运行不到一天出现这个问题,发下是MySQL8小时内无请求自动断开连接。...

空空如也

空空如也

1 2 3 4
收藏数 66
精华内容 26
关键字:

was数据源连接池