Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道,当我关闭我的 JPA + Hibernate 实体管理器时,是否真的总是会签入到 c3p0 连接池的连接。从我的应用程序的日志中,我有时观察到情况并非总是如此,即实体管理器将被关闭,之后不会发生对连接池的签入。只有当达到 maxConnectionAge 时,这些连接才会被销毁。但是,我认为这有时可能很危险,因为我有时也观察到连接将再次被重新利用,尽管连接几乎达到了最大连接年龄。所以我认为最好不提供这些连接以进行结帐,即,更喜欢年轻的连接进行结帐,或者?
好的,问题是我的 maxConnectionAge 和 unreturnedConnectionTimeout 的时间间隔相同。所以事实证明,应用程序中仍然有一些打开的连接(现在已被识别和消除;))。
NOTE: SSCCE at the end of this question
I'm new to SwingWorker so please bear with me.
SwingWorker
I'm using a GUI and when the user presses a button it executes s