现在的位置: 首页 > 综合 > 正文

Proxool升级

2012年12月02日 ⁄ 综合 ⁄ 共 4325字 ⁄ 字号 评论关闭

  很久了,Proxool官方都没有对它进行升级,一直用着Proxool,不免有点失落的感觉,但最近,终于盼来了proxool-0.9.0RC2版本。
  性能方面只能引用官方的说法,自己无法测试,但在一些小Bug上却得到了修正。最明显的就是关闭连接池时的错误已经不再存在:
  这是0.8.3版本关闭时发生的异常:

2006-05-26 11:15:29,171 INFO [org.logicalcobwebs.proxool.DBPool] - Shutting down 'DBPool' pool immediately [Shutdown Hook]
2006-05-26 11:15:29,187 ERROR [org.logicalcobwebs.proxool.ShutdownHook] - Problem calling "get cause" on IllegalStateException.
java.lang.reflect.InvocationTargetException
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.logicalcobwebs.proxool.ShutdownHook.remove(ShutdownHook.java:40)
 at org.logicalcobwebs.proxool.ProxoolFacade.shutdown(ProxoolFacade.java:238)
 at org.logicalcobwebs.proxool.ProxoolFacade.shutdown(ProxoolFacade.java:220)
 at org.logicalcobwebs.proxool.ShutdownHook.run(ShutdownHook.java:99)
 at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalStateException: Shutdown in progress
 at java.lang.Shutdown.remove(Unknown Source)
 at java.lang.Runtime.removeShutdownHook(Unknown Source)
  9 more

  下面是proxool-0.9.0RC2时的关闭状态:

2006-05-26 11:23:42,515 INFO [org.logicalcobwebs.proxool.DBPool] - Shutting down 'DBPool' pool immediately [Shutdown Hook]
2006-05-26 11:23:42,515 INFO [org.logicalcobwebs.proxool.PrototyperController] - Stopping Prototyper thread
2006-05-26 11:23:42,515 INFO [org.logicalcobwebs.proxool.HouseKeeperController] - Stopping HouseKeeper thread

  
  正常关闭!!
  虽然对一般的应用来说,在关闭阶段发生异常对正常业务没有什么影响,但在一些特殊应用中,却不能正常使用了。呵呵,怎么说,也算是Proxool给我们这些支持者一个很大的鼓励。
  新版本的更新内容,引用官方的话是:

Changes to Proxool
0.9.0RC2
- The Statement.getConnection() method now returns the wrapped connection rather than the delegate, aloowing you to close() it safely.
- Repackaged Cglib 2.1_3 (including its own repackaged version of ASM). Cglib is now repackaged using JarJar (see the repackage-cglib Ant target in the source distribution). One of the goals of this upgrade is to get Proxool to work with JDK 1.6 - more testing is needed before we can know the status of that. (Note that you can't build Proxool from source with 1.6 yet because if unimplemented methods in DataSource).
- You can now configure the DataSource with delegate properties. Use the delegateProperties property.
0.9.0RC1 - 2 March 2006
- All connections are now wrapped in disposable wrappers. This means that once you have closed a connection (thereby returning it to the pool) you can no longer do anything to it that might influence its behaviour for the next client that picks it up.
- Connections, Statements, PreparedStatements, and CallableStatements now implement all the public intefaces that the delegate connection does. This means that you can, for instance, cast a Connection directly to the driver specific one. Or more precisely, any of the interfaces that the driver object implements. You can only cast your exception into an interface - concrete classes aren't supported at this time.
- You can now inject interfaces for proxied objects that expose public methods that aren't declared in an interface. So if your vendor Connection, Statement, PreparedStatement or CallableStatement have any public methods that aren't declared in an interface (and therefore not exposed automatically) you can just write your own interface that declares the same signature. Even though the vendor object doesn't implement your interface directly, the proxied object will behave as if it does.
- ProxoolFacade now has killConnection that accepts the Connection object itself, so you don't have to know the pool alias and connection ID.
- ProxoolFacade now has getId() which will give you the ID for any connection.
- ProxoolFacade now has getAlias() which will give you the pool alias for any connection.
- ProxoolFacade now has a no-parameter overloaded version of shutdown() for ease of integration with the Spring Framework.
- ProxoolDriver no longer logs all SQLExceptions. It's up to the client to log exceptions as it sees fit. (With some changes to the tests, this means that we no longer get any stack traces output during testing when we encounter *expected* errors).
- Experimental DataSource implementation. Actually, we think it's ready for use but we haven't really had time to think about documenting it. We do have something though.
- Jakarta's Commons Logging is no longer bundled with the source and is now a dependency. We had forked this component (at their version 1.02) to make it simpler for us to deploy but there are advantages, particular with respect to configuration, to just using the component direct from Jakarta.

官方地址:http://proxool.sourceforge.net/changelog.html

             --原创文章,可以随意复制发表,但请注明出处与作者
                   BY YCOE

抱歉!评论已关闭.