It sounds like the newer cloud SQL JDBC drivers for app engine (1) support connection pooling.
Our app uses Spring+Hibernate and we're trying to use one of the existing java frameworks for connection pooling (BoneCP, C3p0, Hikari), and have failed so far to use any of them because of app engine limitations. Stack trace using Spring+Hibernate+C3p0 below. Did anyone manage to get this to work?
[INFO] java.lang.NoClassDefFoundError: java.lang.management.ManagementFactory is a restricted class. Please see the Google App Engine developer's guide for more details.
[INFO] at com.google.appengine.tools.development.agent.runtime.Runtime.reject(Runtime.java:51)
[INFO] at com.mchange.v2.c3p0.management.ActiveManagementCoordinator.<init>(ActiveManagementCoordinator.java:54)
[INFO] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[INFO] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
[INFO] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[INFO] at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
[INFO] at com.google.appengine.tools.development.agent.runtime.Runtime.newInstance_(Runtime.java:127)
[INFO] at com.google.appengine.tools.development.agent.runtime.Runtime.newInstance(Runtime.java:148)
[INFO] at com.mchange.v2.c3p0.C3P0Registry.<clinit>(C3P0Registry.java:146)
[INFO] at java.lang.Class.forName0(Native Method)
[INFO] at java.lang.Class.forName(Class.java:190)
[INFO] at com.google.appengine.tools.development.agent.runtime.RuntimeHelper.checkRestricted(RuntimeHelper.java:70)
[INFO] at com.google.appengine.tools.development.agent.runtime.Runtime.checkRestricted(Runtime.java:64)
[INFO] at com.mchange.v2.c3p0.impl.DriverManagerDataSourceBase.<init>(DriverManagerDataSourceBase.java:212)
[INFO] at com.mchange.v2.c3p0.DriverManagerDataSource.<init>(DriverManagerDataSource.java:72)
....
(1): Old driver = com.google.appengine.api.rdbms.AppEngineDriver. New driver = com.mysql.jdbc.GoogleDriver.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…