私はGWTとHibernate、c3p0、およびMySQLを使用して、限られたオーディエンス(1日あたり最大50ユーザー)でWebアプリを作成しています。close()テスト中に、メソッドの使用に関係なく、Hibernateが各セッションとの接続を開いていたが、閉じていなかったことがわかりました。
私の現在の構成は次のとおりです。
hibernate.connection.driver_class=com.mysql.jdbc.Driver
hibernate.connection.url=
hibernate.connection.username=
hibernate.connection.password=
hibernate.dialect=org.hibernate.dialect.MySQLDialect
hibernate.current_session_context_class=thread
hibernate.c3p0.min_size=1
hibernate.c3p0.max_size=1
hibernate.c3p0.timeout=10
hibernate.c3p0.max_statements=50
hibernate.c3p0.idle_test_period=10
hibernate.c3p0.unreturned_connection_timeout=1
hibernate.connection.provider_class=org.hibernate.connection.C3P0ConnectionProvider
アプリケーションへの新しい接続ごとに、新しいプールが作成されます。たとえば、プールサイズを3に設定した場合、アプリケーションへの2つの接続は、アプリケーションが閉じられるまで6つの接続になります。
意図された動作は、各トランザクションの後に接続を単に閉じるか再利用することです。どうすればこれを達成できますか?