-
Notifications
You must be signed in to change notification settings - Fork 338
/
CHANGELOG
1736 lines (1725 loc) · 116 KB
/
CHANGELOG
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
-- Prevent freeze due to re-waiting if a non-Exception Throwable occurs
while acquiring a PreparedStatement to cache. Thanks Totyo Totev!
c3p0-0.10.1
-- Implement more and "louder" (log ugly stack traces) validation of
config properties.
-- Modify former InUseLock (now InternalUseLock) and NewProxyConnection
to use ReentrantLock rather than native monitors, to prevent pinning
when clients run on loom virtual threads.
Thanks Alex Kormukhin and Jeffrey Tucker!
-- Implement config parameter markSessionBoundaries, so that users can
disable JDBC 4.3 beginRequest / endRequest session boundary marking
when JDBC drivers so undesirable things with those hints.
Thanks Bikas Anand!
-- Implement more careful examination of begin/endRequest methods, to take
into account the case where those methods exist on the JDBC driver Connection
implementation, but not in the Connection interface of a pre-Java-9 JVM.
We still support begin/endRequest in this case, but reflectively.
Thanks Vlad Skarzhevskyy, khushboo11-dotcom!
c3p0-0.10.0
-- A bit more testing
c3p0-0.10.0-pre7
-- Improve performance of begin/endRequest support
-- Implement c3p0-loom UninstrumentedVirtualThreadPerTaskTaskRunnerFactory
-- Change mind. Eliminate naggingly prescriptive equals/hashCode pseudorequirements
from plugin interfaces, because our canonicalization strategy is by key, doesn' actually
rely upon those implementations.
-- Guard collection of MBeanAttributeInfo against items that would have no getter
or setter to prevent ugly IntrospectionExceptions.
See https://github.com/swaldman/c3p0/issues/128
Thanks @philippscs!
-- Let C3P0PooledConnectionPool manager test introspected authentication that appears
perhaps incomplete, and revert to NULL_AUTH (no-arg DataSource.getConnection()) if
the test fails.
See, should address, https://github.com/swaldman/c3p0/issues/159
Thanks @sbaeumlisberger!
c3p0-0.10.0-pre6
-- Lots of documentation work.
-- Implement attemptResurrectOnCheckin config parameter.
See https://github.com/swaldman/c3p0/issues/47
Thanks Bartosz Radaczyński and Igor Khromov!
-- Add guard to automaticTestTable preventing use of weird or potentially malicious table names.
Thanks to Andy at Privitar
-- Pick up com.mchange.v2.c3p0.impl.DefaultConnectionTester.isValidTimeout as default
value of new connectionIsValidTimeout property, so that users upgrading from previous
version still capture the setting from the old config, even as their ConnectionTester
now falls back to null.
c3p0-0.10.0-pre5
-- Lots of documenting, condensing, clean-up, etc.
-- Define connectionIsValidTimeout as an ordinary bean-style config parameter.
Previously users had to set a universal property (in c3p0.properties or System
properties) to set this timeout.
-- Use simplified isValid(...) based timeout by default, use traditional
ConnectionTester logic only when users specify or force a ConnectionTester
c3p0-0.10.0-pre4
-- Define (in a separate, Java 21, project) a loom virtual-threads based
TaskRunnerFactory, VirtualThreadPerTaskExecutorTaskRunnerFactory.
See https://github.com/swaldman/c3p0-loom
-- DefineFixedThreadPoolExecutorTaskRunnerFactory, a simple example that
replaces c3p0's traditional Thread pool with an unshared ThreadPoolExecutor
of size numHelperThreads.
-- Define AbstractExecutorTaskRunnerFactory, which users can extend to use or
share java.util.concurrent.Executor instances rather than c3p0's traditional
hand-rolled Thread pool.
See https://github.com/swaldman/c3p0/issues/76
https://github.com/swaldman/c3p0/issues/41
Thanks Michele Rossi, and mysterious GitHub @ghost.
-- Define TaskRunnerFactory, and config param TaskRunnerFactoryClassName.
Users can provide implementations of TaskRunnerFactory with a public no-arg
constructor to take full control of threading, thread-pooling, etc.
-- Support SOURCE_DATE_EPOCH for deterministic builds.
(Here and in mchange-commons-java.)
See https://github.com/swaldman/c3p0/issues/163
https://reproducible-builds.org/docs/source-date-epoch/
https://github.com/swaldman/mchange-commons-java/commit/09480482ddde70b98baf8437e66c5e3bba9ae3e2
Thanks Bernhard M. Wiedemann!
-- Eliminate support for traditional reflective proxies.
-- Fix bad anchor in docs, thanks Hakan!
-- Relicense to allow users to opt for LGPL-2.1 or later, rather than LGPL-2.1-only.
(Here and in mchange-commons-java.)
See https://github.com/swaldman/c3p0/issues/133
Thanks Bernhard E. Reiter!
-- Update to mchange-commons-java 0.3.0
c3p0-0.10.0-pre3
-- Have build fail if we try to build with an unexpected JVM version.
We want to use a consistent JVM version (currently 11) and target version (currently 7)
when we build c3p0.
-- Remove vestiges of unsupported BasicResourcePool.AcquireTask
-- Disable very slow handholding function intended to help with misspellings / misspecifications
of resource "/c3p0-config.xml"
See https://github.com/swaldman/c3p0/issues/121
Thanks chinhodado!
-- Let PooledDataSource implement AutoCloseable.
This necessitates targeting Java 7, rather than Java 6, classfiles.
Thanks koszta5!
-- Bring documentation of acquireRetryAttempts into sync with c3p0's actual behavior.
See https://github.com/swaldman/c3p0/issues/132
Thanks marcatl, MichaelMih, Leona Nezvalova!
-- Include license files in published source jar.
(Here and in mchange-commons-java.)
See https://github.com/swaldman/c3p0/issues/167
c3p0-0.10.0-pre2
-- Add "Automatic-Module-Name" entry to jar manifest for interoperability with Project Jigsaw / Java 9 modules
See https://github.com/swaldman/c3p0/issues/171
Thanks Jörg Hohwiller
-- Try context ClassLoader if library ClassLoader fails to load a named, necessary driver class.
See https://github.com/swaldman/c3p0/pull/115
Thanks Rodrigo Merino!
-- Let statement cache fail not-quietly if drivers provide PreparedStatements without a proper equals implementation.
See https://github.com/swaldman/c3p0/pull/59/
Thanks Thomas Beckmann!
-- Be slightly less negative in the docs about unreturnedConnectionTimeout.
See https://github.com/swaldman/c3p0/pull/160
Thanks Matteo Mazza!
-- Implement more robustly accurate checkoutTimeout.
See https://github.com/swaldman/c3p0/pull/138 https://github.com/swaldman/c3p0/issues/137
Thanks François JACQUES!
-- Add support for JDBC 4.3 beginRequest and endRequest methods.
See https://github.com/swaldman/c3p0/pull/170
Thanks Fernanda Meheust!
-- Consider ourselves to be a wrapper for a thing if the thing we wrap itself declares itself
as the wrapper of that thing. See https://github.com/swaldman/c3p0/pull/149
Thanks François JACQUES!
-- Fix rare ConcurrentModificationException in GooGooStatementCache when Connections are
closed. See https://github.com/swaldman/c3p0/pull/22
Thanks Mathilde Ffrench, Joel Caplin!
c3p0-0.10.0-pre1
-- Fix doc comments no longer acceptable under persnicketty JDK 11
-- Build with JDK 11 JVM (still emitting JDK 1.6 compatible sources)
-- Get tests working under new mill build
-- Reorganize to switch build from ant to mill
-- Update to mchange-commons-java 0.2.20
c3p0-0.9.5.5
-- Update docs to describe new com.mchange.v2.log.MLog.useRedirectableLoggers setting, implemented
in mchange-commons-java 0.2.19
-- Update to mchange-commons-java 0.2.19
-- Properly implement the JDBC 4.1 abort method. Thanks to Andrew Johnson for calling attention
to this issue.
c3p0-0.9.5.4
-- Disabling entity expansions, as we did in v.0.9.5.3 turns out not to be sufficient to prevent all
XML-config parsing related attacks (if an attacker can control the XML config file that will be
parsed). We now make XML parsing much more restrictove by default, but allow users to revert to the
old, permissive pre-0.9.5.3 behavior by setting config property 'com.mchange.v2.c3p0.cfg.xml.usePermissiveParser'
to true. That property replaces and leaves deprecated the 'com.mchange.v2.c3p0.cfg.xml.expandEntityReferences'
property introduced on 0.9.5.3. Many thanks to Aaron Massey (amassey) at HackerOne for calling attention
to the continued vulnerability of XML parsing to these kinds of attacks.
-- Address situation where a throwable during forceKillAcquires() left the force_kill_acquires flag
set to true, making it impossible for the pool to restart acquisition attempts on recovery. We
now unset the flag under any circumstance, but log interrupts or unexpected throwables, and make
a best effort to complete the intended expiration of waiting clients by throwing InterruptException
Many thanks to Stefan Cordes (rscadrde on github), Vipin Nair (swvist on github), and Łukasz Jąder
(ljader on github) for their work on this issue.
c3p0-0.9.5.3
-- Address CVE-2018-20433, https://nvd.nist.gov/vuln/detail/CVE-2018-20433 re liberal parsing of
XML config. By default, c3p0 no longer expands entity references in XML config files. This
behavior can be overridden via config property 'com.mchange.v2.c3p0.cfg.xml.expandEntityReferences'
by applications that understand the security concerns but wish to make use of entity references.
Thanks to user zhutougg on GitHub for calling attention to and suggesting a fix for this issue.
-- Upgrade dependency to mchange-commons-java 0.2.15, which includes support for log4j2 (implemented
in mchange-commons-java by GitHub user fireandfuel. Many thanks!
c3p0-0.9.5.2
-- Fix a bug in MLog bridge to slf4j logging, in which loggability of levels of wrapped loggers
was misreported, leading to useless allocation of log Strings below the logging threshold. Grr.
[change is in mchange-commons-java 0.2.11]. Many thanks to Lewis Wong on Stack Exchange for calling
attention to this issue.
-- Embed last acquistion failure as nested Exception in CannotAcquireResourceException. Thanks to
nigam on github for this addition.
c3p0-0.9.5.1
-- Implemented configuration property com.mchange.v2.c3p0.impl.DefaultConnectionTester.isValidTimeout
to define timeouts on tests based on Connection.isValid(...). Many thanks to james-hu on github
for suggesting this.
-- Added a forceSynchronousCheckins config param, which can be a significant performance boost
if no tests are performed on checkin and no long work is performed in ConnectionCustomizer.onCheckIn(...).
The parameter is particularly useful for installations in which the Thread pool is under stress,
as it permits prompt checkins without use of the Thread pool, and helps reduce Thread pool congestion.
Many thanks to Vamsi Krishna for calling attention to this issue.
-- Removed embarrassingly frivolous nested locking in C3P0Registry which provoked rare deadlocks
when users lookup extensions. Many thanks to Vlad Skarzhevskyy for calling attention to this
issue.
-- ScatteredAcquireTask now tests to see if a BasicResourcePool has already been closed before
attempting an acquisition. Thanks to kenicky on github for calling attention to this issue.
c3p0-0.9.5
-- Fixed small typo in log message, thanks Jaran Nilsen
-- DriverManagerDataSource: Added synchronization missing for the very rare case of an on-the-fly
reset of 'driverClass'; minor optimization, properly marked driver class loaded if an instantiation
of the driver has succeeded.
c3p0-0.9.5-pre10
-- Removed support for try-with-resources (implementation of marker interface java.lang.AutoCloseable)
as it breaks Java6 support. I'll save it for 0.9.6 (unless I get a lot of complaints).
Thanks again to dwscott on github.
-- Added config parameter com.mchange.v2.c3p0.management.ExcludeIdentityToken that allows users to
have c3p0 generate predictable, reproducible full JMX ObjectNames (at the cost of extra user
responsibility in ensuring the uniqueness of those names). Updated and expanded documentation
with respect to JMX support. Thanks to dwscott on github for suggesting this improvement.
c3p0-0.9.5-pre9
-- In mchange-commons-java, modified log library to consider slf4j library unfound if it gets bound to its
no-op ('NOP') back-end.
-- Gave proxies a toString() method that embeds the toString() method of the objects they are wrapping, including
Statement text if the underlying driver supports that. Thanks to Ketan Padegaonkar for the suggestion.
-- Added API [in mchange-commons-java] to make it easier for users to create a MultiPropertiesConfig object from a
Properties object, which will enable use of the new C3P0Config.refreshMainConfig( overrides, overridesDescription )
method, which may enable some useful dynamic configuarion possibilities, see e.g. https://sourceforge.net/p/c3p0/bugs/121/
Thanks to Vlad Skarzhevskyy on SourceForge for the proposed use case.
-- Modified mchange-commons-java (and c3p0 docs) to prioritize slf4j over log4j if both are available in the application
classpath and com.mchange.v2.log.MLog has not been explicitly set. Thanks to Steve Ramage for the suggestion.
-- If a problem occurs while acquiring a cached Statement from the Statement pool, the Exception we throw includes
both the actual problem (which occurs in a helper thread) and the stack trace of the client which provoked the
failed acquisition. The problem that occurred within the helper thread is captured as the root cause Throwable.
Many thanks to Michele Rossi for the suggestion.
-- Finally wrapped StackOverflowError that comes in the rare, pathological case when every attempt to checkout
a resource fails some test or check until eventually recursive retries blow the stack. A NoGoodResourcesException
is now thrown in this case. Thanks to Ibenda on github for calling attention to the issue (and others annoyed by
it long ago). [Note: The StackOverflowError remains accessible, wrapped as the root cause Exception. So I expect
continuing bug reports / complaints about a StackOverflowException from users who don't notice it is caught and
handled.]
-- Some documentation updates and fixes.
-- Made PooledDataSource AutoCloseable, so that try with resources can be used to clean up after them.
-- Added some warnings in BasicResourcePool's constructor if min, max, and start are misordered.
Misordered values are reordered. Thanks to bronzenose on github for the suggestion.
-- Overloaded AbstractPoolBackedDataSource / AbstractComboPoolBackedDataSource toString,
so we've a toString( boolean show_config ). The full reflective config is now shown only when logging
pool manager initialization. Otherwise we revert to a fast, nonreflective toString(). We'll see whether anyone
minds the abbreviation. Thanks to kibertoad and Xerosigma on github for the suggestion.
-- Fixed implementations of wrap( ... ) / isWrapperFor( ... ) to properly conform to spec when given an interface implemented
directly by the receiver of the wrap( ... ) call. Many thanks to baracil on github for calling attention to this issue.
c3p0-0.9.5-pre8
-- Resolved a Serialization problem introduced in c3p0-0.9.5-pre7 (Broke serializability of DefaultConnectionTester
and therefore typical instances of WrapperConnectionPoolDataSource.) Many thanks to Petar Tachiev for calling attention to this issue.
-- [in mchange-commons-java] Fixed a latent issue where decoding of JNDI References would fail if the Object factory
was not loaded by the System ClassLoader. (This issue was revealed when Serialization failures provoked fallback
to a Reference Serialization strategy.) Many thanks to Petar Tachiev for calling attention to this issue.
c3p0-0.9.5-pre7
-- Cleaned up (and exposed a configuration property to tweak) selection of Connection tests when
no query is provided. Do we use Connection.isValid(...), the traditional DatabaseMetaData-based test,
something else? Now, by default we try isValid(...) but we back-off to the traditional test on error.
But this behavior is configurable via the property 'com.mchange.v2.c3p0.impl.DefaultConnectionTester.querylessTestRunner'
(which is documented with 'Other Properties').
-- Added config parameter 'forceUseNamedDriverClass', which ensures that an instance of the class named in
'driverClass' is used as the JDBC driver, rather than simply preloading the named class and then
relying upon DriverManager to determine which driver to use. Thanks to Martin Coene and meinc on SourceForge
for calling attention to this issue.
-- We now support the parentLogger property of DataSources (rather than just throwing an SQLFeatureNotSupportedException).
This should resolve the issue identified by Maarten Coene (thanks!), where JMX clients repeatedly see
Exceptions as they try to read the parentLogger property.
-- [in mchange commons java] MLog levels WARNING and SEVERE were misordered due to bad copy/paste of
the integer value of levels. Many thanks to Martin Coene for discovering and tracking down the problem.
-- [in mchange commons java] An error in MLog logging to log4j caused an IllegalArgumentException
at log level OFF. This problem was identified and fixed by Sebastian Baumhekel
-- [in mchange commons java] Defines a jdk14logging ForwardingLogger that adapts MLog Loggers into
JDK14 (java.util.logging) Loggers
-- Unused resources cleaned up on BasicResourcePool close() are properly added to the formerResources
WeakHashMap, to prevent multiple checkins of those resources from triggering foreign resource warnings.
Thanks again to Brett Wooldridge for calling attention to this issue.
-- Guarded marking of transactions as maybe dirty in Statement proxies, so that they don't trigger NPEs
then Exceptions for illegal operation on a closed Connection for methods like Connection.isClosed.
Many thanks to Brett Wooldridge for calling attention to this issue.
-- Prevent JMX clients from updating properties on underlying pools (and therefore potentially
triggering a wind-down / reconstruction of internal pools) if the new value of the property
is the same as the original value. Thanks to ask-dev on Stack Overflow for calling attention
to this issue.
-- Guard against case where connectionCustomizerClassName is an empty or blank String.
Thanks to ask-dev on Stack Overflow for calling attention to this issue.
-- Fixed typos is docs where testConnectionOnCheckout and testConnectionOnCheckin
erroneously included excess capital letters, testConnectionOnCheckOut and testConnectionOnCheckIn.
Thanks to Usman Mutawakil for finding and reporting this issue.
-- For drivers that support JDBC4 Connection.isValid(), this becomes the default
Connection test if no preferredTestQuery / automaticTestTable is specified.
HOWEVER, for older drivers that do not support Connection.isValid(), the already
slow default test becomes EVEN SLOWER than its already legendary slowness. If
you are using a driver that you know supports Connection.isValid(), you can skip
setting preferredTestQuery or automaticTestTable. But if you are not sure, better
set one of these or endure painfully slow tests.
c3p0-0.9.5-pre6
-- Fixed a rare problem caused when some JDBC drivers are simultaneously autoloaded
on initialization of DriverManager.class and by DriverManagerDataSource.
DriverManagerDataSource's class init now preloads DriverManager.class
-- Fixed a ClassCastException in some codepaths of BasicResourceFactory construction.
Thanks to petrjanata on SourceForge for reporting and tracking down the issue.
-- Modified mlog logging library to permit dynamic refresh if config (again, for
integration with dynamically-reloading appservers).
-- Refactored C3P0Config to permit refreshing of config information on-demand at
runtime, plus imposing overrides. (This is in preperation for integration with
application servers, whose native config files might be used to configure c3p0,
and might change more frequently than a VM or ClassLoader recycle).
-- Improvements to loading of resources for hocon/typesafe-config. We now properly
load and merge multiple resources (if found), and use typesafe conventions for
merging xxx.conf, xxx.json, and xxx.properties files. [mchange-commons-java]
-- Cleaned up reflection of default properties, such that only coercible properties
get Stringified (since Stringifying non-coercible properties render them useless
for setting as bean params), and to eliminate treating C3P0Defaults.getKnownProperties
as itself a default. Many thanks to wuSam on github for exercising the library in an
unusual way and revealing these issues.
c3p0-0.9.5-pre5
-- Made JMX names of C3P0Registry customizable via the config property
'com.mchange.v2.c3p0.management.RegistryName', so that multiple installations/ClassLoaders
can be managed by a single MBean server. Many thanks to Vlad Skarzhevskyy for
calling attention to this issue.
-- Fixed a rare Connection leak in WrapperConnectionPoolDataSource that occurs
when Connection acquisition succeeds but construction of a PooledConnection
to wrap it fails with an Exception. Many thanks to Edward Chan for reporting
the issue.
-- Fixed an error introduced in the 0.9.2 series, which caused MBeans
for PooledDataSources to be unregistered on close() under names different
from that under which they were registered, creating a memory leak.
Many thanks to Vlad Skarzhevskyy for reporting this issue.
c3p0-0.9.5-pre4
-- Updated documentation with user-defined configuration extensions and
information on how to define named configuration, per-user overrides,
and user-defined extensions in all three supported config file formats.
-- Implemented user-defined configuration extensions.
-- Implemented properties file and HOCON definition of named configurations
and per-user overrides.
-- Added privilegeSpawnedThreads config parameter, mostly to detach caller's
AccessControlContext from Threads that provoke the init, to prevent references from
c3p0 Threads to app server (esp tomcat) ClassLoaders that ought to be garbage-
collectable on hot undeploy. Might also be useful for helping c3p0 run from less
trusted code, although that has not come up yet. Thanks to Claudio D'angelo for
calling attention to the issue.
-- Added new config parameter 'contextClassLoaderSource', which can be set to one of
'caller', 'library', or 'none'. By default, the Thread that provokes pool initialization
passes its ContextClassLoader to c3p0-spawned Threads, which makes it impossible to garbage
collect those classloaders in e.g. application server undeploys. Setting this parameter to
'library' (rather than the default 'caller') forces c3p0-spawned Threads to use the
ClassLoader that loaded c3p0 as the contextClassLoader.
-- clone() System.getProperties() when reading config, to avoid potential
ConcurrentModificationExceptions if other Threads are messing with System properties.
Thanks Keith Amling! [mchange-commons-java]
-- Access to EncounterCounter in C3P0ImplUtils ought to have been synchronized. It was
not. Fixed, by placing the counter underneath an sync'ed wrapper. Many thanks to
Keith Amling and Dan Berindei for calling attention to this issue.
c3p0-0.9.5-pre3
-- For reasons that remain obscure, the published build of c3p0-0.9.5-pre2 is missing
JDBC4 methods (many thanks to edysli on github for pointing this out). Apparently
it was accidentally built against JDBC3 libraries. Added a compile-time check
for JDBC4 api in generated code to C3P0ImplUtils.
-- Divided ComboPooledDataSource into final implementation class and an abstract class
which can be extended to derive debugging filters. Created two such filters,
com.mchange.v2.c3p0.debug.AfterCloseLoggingComboPooledDataSource and
com.mchange.v2.c3p0.debug.CloseLoggingComboPooledDataSource
-- C3P0PooledConnectionPool destroyResource() calls are now protected by in-use resource
locks to prevent rare deadlocks during simultaneous test / destroy.
-- HOCON resources are now loaded as a single group, so that resolution of substitutions
works across multiple files.
-- Fixed bug in HOCON support where files that include substitutions like ${myScope.varName}
would throw a ConfigException.NotResolved. These substitutions are now resolved. Many thanks
to Stjepan Buljat for calling attention to this issue.
-- Support standard HOCON config files application.properties and application.json as well
as application.conf
-- Fixed ClassCastException when (now deprecated!) usesTraditionalReflectiveProxies is set to
true. Many thanks to Konrad Garus for reporting the issue.
-- NewProxyConnectionGenerator has been modified so that Connections only mark transactions
as known-resolved after the putatively resolving operation has successfully completed,
rather than when it is merely attempted.
-- With FINEST/TRACE debug logging, full JVM stack traces are now emitted during any
ThreadPoolAsynchronousRunner APPARENT DEADLOCKS, to help debug any deadlocks within the JVM.
-- Made constructors of delegated proxies package-visible rather than public. Many thanks to
Oliver Zemann for calling attention to this issue.
-- Some fixes and improvements to cfg and log libraries, so that fewer superfluous warnings
get emitted on startup.
c3p0-0.9.5-pre2
-- Modified unwrap / isWrapperFor methods in proxies to be more permissive, to accept class
objects for superinterfaces of the wrapped interface as well as of implementation
classes.
-- Added support for SLF4J / logback logging, defined short aliases for adapters to
the various logging libraries, updated documentation with new logging features
-- Added and documented HOCON / typesafe-config libary support, available if (and only if)
the typesafe-config library is included with the application.
-- Refactored mchange-commons-java to eliminate very rare potential deadlocks under simultaneous
ClassLoading of file in cfg and log packages, and defined a facade into the cfg library use of
which should eliminate the possibility of such deadlocks if it is used assiduously.
-- actually documented 'com.mchange.v2.log.jdk14logging.suppressStackWalk'. i said i had earlier
but apparently not
-- set 'com.mchange.v2.log.jdk14logging.suppressStackWalk' to true by default in mchange-commons-java
c3p0-0.9.5-pre1
-- Included 'com.mchange.v2.log.jdk14logging.suppressStackWalk' in c3p0 docs.
-- In mchange-commons: Added a config property for jdk14 logging users:
'com.mchange.v2.log.jdk14logging.suppressStackWalk' allows clients to speed up logging
by suppressing analyzing the stack trace for the caller. (Only the name of the logger will
be given.)
-- Modified DataSource to include an (unsupported) getParentLogger() method for JDK7 builds
-- Handle JDBC4 Connection.isValid properly
-- Lots of updates to get c3p0 to proxy and compile JDBC4
-- Removed some jdk14 support stuff from build.properties
c3p0-0.9.2.1
-- Dual licensed c3p0, LGPL v.2.1 and EPL 1.0. Modified license files, source headers, etc.
c3p0-0.9.2
-- Updated documentation re hibernate configuration. (Documentation was several years stale.)
-- Merged John Sumsion's remarkable integration of c3p0's full SourceForge history into the
git repository. (Enormous, huge thanks to John Sumsion!)
c3p0-0.9.2-pre8
-- Added logging (at level FINE, in com.mchange.v2.c3p0.impl.C3P0PooledConnectionPoolManager) when
a pool is initialized for a new authentication within a DataSource.
-- We now allow users to place an XML formatted config file in arbitrary locations under
the classpath (i.e. as ClassLoader resource), including jar file META-INF directories.
If the config property com.mchange.v2.c3p0.cfg.xml begins with "classloader:", the remainder of
the String will be interpreted as a ClassLoader resource path. Thanks to Sam Razialruh for
suggesting this feature.
-- In DataSources.pooledDataSource( DataSource unpooledDataSource, Properties props ), switched
from using keySet().iterator() to the propertyNames() Enumeration to properly capture keys
set in the Properties object's defaults. Thanks to Jisakiel in SourceForge for calling attention
to this issue.
-- Modified DelegatorGenerator [in mchange-commons-java] to delegate reflectively at
runtime via the main delegation interface (by default, and in c3p0's proxies), rather
than via the runtime class, which may not be public. (Added a bit of API to DelegatorGenerator
so that users can specify whether reflective delegation should be via the main
delegation interface, some other expected superclass or interface, or the actual
runtime class.) Many thanks to Kiran Kollipara for pointing out the risk of IllegalAccessExceptions
under the previous implementation.
c3p0-0.9.2-pre7
-- Added hooks [in mchange-commons-java] to com.mchange.v2.codegen.intc.DelegatorGenerator
to permit reflective delegation of methods not declared by the main interface. Added
some unproblematic JDBC4 methods to generated PreparedStatement proxies in order (hopefully)
to workaround hibernate issues. (see https://hibernate.onjira.com/browse/HHH-7801 and
https://hibernate.onjira.com/browse/HHH-7778 )
-- Added some extra logging (at level FINER [or DEBUG] to NewPooledConnection, in hopes
that it will be helpful in tracking down Exceptions that occur during automatic cleanup
of unclosed Statements and ResultSets.
c3p0-0.9.2-pre6
-- Added some logic that continues to enforce sequential (i.e. nonsimultaneous) use of
PooledConnections in Connection tests, without requiriing Threads to use NewPooledConnection's
lock. Clients of NewPooledConnection should not hold its lock directly, to avoid
potential deadlocks due to Connection eent handlers. [Many thanks to Jan Zuchhold
for calling attention to this problem.]
-- Added a DEBUG STACK TRACE at log level FINEST in BasicResourcePool for tracking the cause
of resource exclusion.
-- Added a README.md file for github.
-- Updated documentation to include dataSourceName as a config parameter, and to describe
its use in generating stable JMX identifers.
-- Made dataSourceName a first-class config parameter, configurable in all the usual ways,
to help support its use for stable JMX names.
-- Included (excellent, very lightweight) patch by Bryan Varner [ https://github.com/bvarner ]
that includes the property dataSourceName in the registered name of c3p0
JMX mbeans. As Varner writes, "This allows you to query mbeans by stable name patterns,
allowing for reliable instrumentation via JMX between VM instances." Many thanks
to Bryan Varner.
-- Updated RELEASE_NOTES
c3p0-0.9.2-pre5
-- Some fixes of issues with per-user config overrides, verified and
updated docs with respect to per-user configs.
-- Unsynchronized access to identityToken in the various identityTokenized
beans, marking the property volatile instead. This should resolve an
occasional deadlock. Many thanks to Phillip Henry, see
https://sourceforge.net/tracker/?func=detail&atid=383690&aid=3552097&group_id=25357
-- Fixed a bug whereunder PoolBackedDataSources threw an Exception
trying to bind per-user overrides that properly should be bound
only to WrapperConnectionPoolDataSource (or to ComboPooledDataSource,
which wraps that). Many thanks to Walter Marcelo Pedrozo Barboza
for calling attention to this issue.
-- Factored out VMID generation into mchange-commons-java.
c3p0-0.9.2-pre4
-- Fixed broken version on Maven dependency to mchange-commons-java.
Version was hardcoded, now uses version number that c3p0 was built
against.
c3p0-0.9.2-pre3
-- Added workaround for bug in Maven 2.2.1 that sometimes leads to corruption
of deployed artifacts. See http://jira.codehaus.org/browse/MNG-4301
-- Eliminated bead RELEASE suffix from use in staging to Maven repository,
which should fix managed dependency problems for Maven users.
-- Required tests of PooledConnections to own the locks associated with those
PooledConnections in order to prevent occasional deadlocks when PooledConnection.close()
coincides with a Connection test. Many thanks to an anonymous SourceForge user for
calling attention to this issue.
c3p0-0.9.2-pre2
-- Added support for deployment to Maven central repository to build.xml,
and noted this version's coordinates in the repository.
-- Added a src directory to the distribution, containing jarred java
sources (including codegenerated sources) intended for debuggers/IDEs.
As a convenience, mchange-commons-java sources are included as well.
-- Fixed issue where idle Connections being tested by the pool
were not properly marked with the statement cache as "in-use".
-- Updated the build file to make it easy to update versions and dates
on source code headers.
-- ResultSets are now automatically closed and their proxies dereferenced
as soon as parent Statements are closed, rather than waiting for the parent
Connection to close as we did before. Thanks to jo-hennig and soronthar for
calling attention to this issue.
-- Modified (in mchange commons library) ThreadPoolAsynchronousRunner to
occasionally (stochastically) call Timer.purge() when maxAdministrativeTaskTime
settings leads to frequent cancellations of TimerTasks. Thanks to Kevin Conaway,
who observed memory issues from the piling up of canceled but unpurged TimerTasks.
-- Modified (in mchange commons library) VersionUtils to be more tolerant
of unusual version Strings. Thanks to martyhu for the suggestion.
-- When a ProxyConnection is marked closed, we now fire a connectionClosed
event even if an Exception occurred during cleanup, to be sure that proxies
detach. We still fire a connectionErrorOccurred prior to connectionClosed,
so that listeners (especially C3P0PooledConnectionPool) can invalidate the
can't-be-cleaned-up PooledConnection.
-- Modified GooGooStatementCache to call clearBatch on PreparedStatement checkin,
so that stale batches from prior use of Statements are never visible to new
users. Many thanks to David Carr for pointing out the problem and the fix.
-- getWarnings and clearWarnings no longer set the txn_known_resolved flag to false.
Thanks to Manuel Darveau for pointing out the unnecessary caution.
-- Gave C3P0PooledConnectionPoolManager's timer a name. Thanks to Matt Kusnierz
for the suggestion.
-- Fixed an infinite loop in ComboPooledDataSource, which occurred following
some Exceptions, which provoked calls to toString() to build the Exception
message, which call itself provoked an Exception, ad infinitum. All potentially
Exception-provoking attribute lookups are now excluded from toString(). Many
thanks to Svante v. Erichsen for calling attention to this problem and
suggesting a fix.
-- Modified the build so that JDK 1.4 compatible versions of c3p0-0.9.2
can be generated easily. (c3p0-0.9.2 will be the last version of c3p0
to support JDK 1.4 builds.)
-- Moved development onto github. See https://github.com/swaldman/c3p0, with
a dependency against https://github.com/swaldman/mchange-commons-java
c3p0-0.9.2-pre1
-- Rationalized management of the ConnectionEventListener that checks in
PooledConnections on proxy Connection close(). Now added on check-out and
removed on check-in, rather than being always present but temporarily removed
during administrative tasks.
-- Implemented asynchronous Statement destroyer, hopefully completing the task of
making the statement cache robust to drivers that cannot deal with Statements
being closed underneath Connections still in use (e.g. Oracle, JTDS). Note
that this implementation requires at least one dedicated Thread for statement
destruction (if we used the common Thread pool, there will be deadlocks as
Statement close tasks await not-in-use Connections, while Connection-related
tasks can't be completed because the Thread pool is saturated with Statement
close tasks. Stats about the asynchronous Statement destroyer are available
via the JMX MBean, prefixed statementDestroyer. Setting the new config parameter
c3p0.statementCacheNumDeferredCloseThreads enables the fix.
-- Resolved a potential race condition that could lead to pool freezes, especially
when acquisitions occasionally fail and acquireIncrement is set to 1. [Many
thanks to Brendan Dougherty for carefully describing this issue.]
-- Added a guard to BasicResourcePool.doAcquire() to ensure that the pool has
not been closed or broken before assimilating a task [Many thanks to
Sean Rohead for tracking down this issue and suggesting the fix.]
-- Made SCATTERED_ACQUIRE_TASK default to true. This provides much better overall
performance for Connection acquisition from potentially unreliable sources
-- Modifed to ensure that unresolved transaction settings apply to expired
unreturned Connections. (see config params autoCommitOnClose and
forceIgnoreUnresolvedTransactions) [Thanks to Matthew Lieder for calling
attention to this issue.]
-- Cleaned up Statement cache fix that ensures no statements are closed while
their parent Connection is in use. By default, the fix is not enabled, because
it's extra work that most databases don't need. [Most drivers support Statement
close() while a parent Connection is in use, so the extra work is unnecessary.]
-- Separated traditional build into two libraries, mchange-commons and c3p0.
-- Modified GooGooStatementCache and C3P0PooledConnectionPool to ensure that
1) the Statement cache knows which Connections are currently in use by outside
clients; and 2) the Statement cache refuses to cull Statements belonging to
Connections in use. Theoretically, drivers should support asynchronous statement
close. In practice, some drivers don't do so nicely, or block pending completion
of other (potentially long) operations, leading to APPARENT DEADLOCKS. (Oracle
users in particular have reported deadlocks in which all pool threads are blocked
on Statement close tasks.) [Many, many thanks to Ovidiu Feodorov for a very detailed
account of problems that occur under c3p0 when very long queries are executed under
Oracle!]
-- Defined a NullMLogger, and modified Log4jMLog to use that, instead of a broken
log4j MLogger, if c3p0's logging library fails to acquire a non-null Log4j logger.
Thanks to Oli Glimmer for calling attention to this issue. (Strange NPEs due to
apparently null log4j loggers have been encountered before, and previous attempts
to resolve apparently weren't adequate.)
-- Fixed a problem whereby ThreadPoolAsynchronousRunner was not robust to Errors provoked
during task execution. [Thanks to George Khoshy for reporting this issue.]
-- Made VersionUtils more robust to cases where some components of the java.version system
property are non-integral [Thanks to Dirk Weigenand for calling attention to this problem,
and suggesting a solution!]
c3p0-0.9.1.2
-- Fixed a variety of latent, hidden bugs discovered by "findbugs". Many thanks to Carsten Heyl
for running this utility and reporting the issues.
-- Added lastAcquisitionFailureDefaultUser to ComboPooledDataSource's TO_STRING_IGNORE_PROPS,
as some moments' Exception doesn't belong in a DataSource's toString(), and as trying to
find this when stringifying close()ed DataSources provoked an infinte recursion (as an Exception
was triggered trying to get the last failure info, which tries to include the stringified
DataSource in its message, again provoking an Exception, ad infinitum.) Many thanks to Santiago
Aguiar for finding and diagnosing this problem.
-- Added better documentation of the com.mchange.v2.c3p0.cfg.xml configuration property.
[Thanks to Legolas Wood for calling attention to this shortcoming.]
-- Calling getHoldability() to find the default Connection holdability provokes an Error
on some DB2 drivers. Added a "careful" check which catches and works around this.
[Thanks to Lari Hotari for finding the problem, and providing a solution!]
-- Refactored NewPooledConnection to not call event multicaster methods while holding
the NewPooledConnection's lock. Holding locks while firing events is an old-fashioned
way of provoking deadlocks, and it turns out c3p0 was not immune. Whoops! Another
embarrassing one. Many thanks to Rhythm Tyagi and Pappu Sharadavani for finding this
deadlock!
c3p0-0.9.1.1
-- Marked variable "logger" in Log4jMLogger. Rare null pointer exceptions apparently
result from a stale value of the previously set variable. Did the same for
Log4jMLogger, although no analoguous issue has thus far been reported. [Thanks to
Noa Resare and Denis on sourceforge for calling attention to this issue.]
-- Hid the attribute "properties" from access via JMX, since it often contains password
information. I don't think properties is particularly useful via JMX, and this seems
like a better solution than returning properties with a hidden/modified password
property, since users might break things unintuitively by resetting a property to
a value that, according to the mbean, was the original value. [Thanks to John Sumsion
for calling attention to this issue.]
-- Fixed bug whereby setting any positive unreturnedConnectionTimeout forced c3p0's default
effectivePropertyCycle down to 1 second. [Many thanks to Luke Dang for tracking down
this bug.]
-- Fixed an embarrassing bug whereby c3p0 was reflectively testing for methods (setHoldability
and setReadOnly) whose argument types are primitive int and boolean, by looking for
Integer.class instead of int.class and Boolean.class instead of boolean.class. [Many
thanks to John Kristian for tracking down this subtle, and embarrassing issue very
precisely and suggesting the fix.]
c3p0-0.9.1
-- Modified logging of uncleared SQLWarnings, so that warnings are emitted at INFO rather
than WARNING, and via a dedicated logger [com.mchange.v2.c3p0.SQLWarnings], so that users
can easily turn this behavior off. [Thanks to Oleksandr Alesinskyy for calling attention
to the annoyingness of unconditionally logging all of this at WARNING.]
c3p0-0.9.1-pre12a
-- Fixed a NullPointerException in DoubleWeakHashMap that showed up thanks to the newly
implemented canonicalization of Jdk14MLog instances. [Many thanks to Carlos Cajina for
finding and reporting this bug.]
c3p0-0.9.1-pre12
-- Modified Jdk14MLog to canonicalize named MLogger instances. In doing so, put the getLogger()
method behind a synchronization barrier, which hopefully will resolve an odd visibility issue
bug reported by a user (wherein the underlying jdk Logger appeared occasionally to be null
in threads that might have initialized prior to the logger) [Thanks to Denis on Sourcefore
for reporting this subtle and interesting issue.]
-- Added a lastAcquisitionFailure property to PooledDataSource (and the JMX view thereof).
Thanks to Troy Whittier for the suggestion, and the patch!
-- SQL Warnings present at Connection acquisition, or uncleared upon Connection checkin
are now logged (at WARNING level) and cleared prior to being made available as part
of the pool. This is necessary to sustain the invariant that all pooled Connections
are identical and interchangible; warnings are Connection state that must be managed
and homogenized. [Thanks to Naxe on the hibernate forums for calling attention to this
issue!]
-- Resolved a rare NullPointerException which occurs when a Statement cache is closed
beneath an active, checked out Connection. A client tries to prepare a Statement,
but the closed Statement cache throws an NPE. Resolved this by having the closed
Statement cache throw a ResourceClosedException, and having c3p0's proxy Statement
recover by generating an uncached PreparedStatement. [Thanks to Sven / ford_perfect
on sourceforge for finding and calling attention to this issue.]
-- Added c3p0 version to C3P0RegistryManagerMBean [Thanks to Sven / ford_perfect
on sourceforge for the suggestion.]
c3p0-0.9.1-pre11
-- Documentation updates, and style-sheet fixes for FireFox.
-- Despite the ugliness, added logic to prepend a VMID to identity
tokens generated for c3p0 DataSources. See the docs (Appendix A,
other configuration properties) for more information. Though there's
little harm in the longer, uglier identityTokens, users who dislike
them can turn them off using the property com.mchange.v2.c3p0.VMID.
-- Wrote ScatteringAcquireTask, which represents a significant change to
how c3p0's underlying resource pool deals with Connections acquisition
failures. c3p0 is designed to retry Connection acquisition up to
"c3p0.acquireRetryAttempts" times (30 by default) with a delay of
"c3p0.acquireRetryDelay" milliseconds (1000 by default) between tries.
Should no Connection be successfully acquired after acquireRetryAttempts,
c3p0 gives up, logs an error, and frees clients waiting to check out
a Connection with an Exception (declaring the pool permanently broken
iff c3p0.breakOnAcquireFailure is set to true).
Connection acquisition is performed asynchronously by c3p0's thread
pool. Under the old implementation, when database Connections could
not be acquired, a single task dispatched to the thread pool would
hog a thread for the full length of the cycle -- 30 seconds by
default -- spending most of that time sleeping between retries.
Under the new implementation, each acquisition attempt is its own
separate task, and if an acquire attempt fails, a timer is used to
schedule a retry adter acquireRetryDelay without hogging any thread.
I think the new implementation is unambiguously superior to the old,
as it permits clients to use smaller thread pools (c3p0.numHelperThreads)
and diminishes the likelihood of apparent thread pool deadlocks.
However, it is too significant a change to introduce this late
in the "mature" c3p0-0.9.1 series, so the old implementation is enabled
by default until the c3p0-0.9.2 development cycle begins.
TO USE THE NEW IMPLEMENTATION WITH c3p0-0.9.1, set...
com.mchange.v2.resourcepool.experimental.useScatteredAcquireTask=true
in a c3p0.properties file or as a system property. Users are strongly
encouraged to set this property. You'll see better resource utilization,
and I'll get to hear issue reports if I've screwed anything up in
the implementation.
-- Modified BasicResourcePool so that checkin (and removal) of resources
is always synchronous if the pool is marked broken. [Otherwise the
check-ins to a closed or broken pool may fail, as they try to use an
already close()ed asynchronous task runner.]
-- Modified BasicResourcePool.AcquireTask so that an interrupt always
forces the whole task to end, not just a single acquisition
attempt.
-- Exposed numThreadsAwaitingCheckout in PooledDataSource interface
and its associated MBean. [Thanks to John Sumsion for suggesting
this property.]
-- Prevented password from being exposed via
DynamicPooledDataSourceManagerMBean. [Thanks to John Sumsion
for calling attention to this oversight!]
-- Fixed an error whereby DataSources.pooledDataSource( ... ) methods
failed to properly set configuration properties defined on
PoolBackedDataSource [e.g. numHelperThreads]. Many thanks to
John Sumsion for noticing the problem and sending the fix!
-- Fixed AbstractConnectionCustomizer to implement (with no-op) methods
the current definition of the ConnectionCustomizer interface. (Failed
to update after modifying an early version of this interface.)
-- Modified NewPooledConnection to only collect stack trace information
on close() when we are debugging at FINEST or DEBUG (log4j) level.
Previously, stack trace information was collected anytime a
c3p0 PooledConnection was close()ed. This was unnecessary, although
the performance cost was probably small to negligible, since
PooledConnections are typically reused many times before they are
close()ed. Stack trace information is still captured when
PooledConnections are destroyed due to an error, rather than an
ordinary call to close().
-- Hid the getLastXXXFailure(user, password) from the operations list of
DynamicPooledDataSourceManagerMBean. The stack traces of failures
are visible via the sampleLastXXXFailureStackTrace(); there's no
need to expose the Throwbales as well via JMX.
-- Added convenience methods getNumPooledDataSources() and getNumPoolsAllDataSources()
to C3P0Registry and the related MBean. [Thanks to lukeda on hibernate
forums for calling attention to the need for a pool count, since
DataSources can wrap multiple pools associated with different
authentications.]
-- Eliminated the "trial Connection acquisition" added to c3p0-0.9.1-pre10
when PooledDataSources construct the pool with their default authentification
information. Effectively we trust that the default auntentification is
good, while we distrust client-specified (or JMX-queried) username/password
combinations, and perform the extra check. This is a compromise, as users
who frequently create and destroy DataSources don't like the extra overhead
of the trial Connection acquisition, but we really want to avoid the initialization
of bad pools when users misspecify authentification information. We've also prevented
mere queries of pool status from triggering the initialization of a
non-default-authentification pool. Only calls to getConnection(user, password)
will provoke the initialization of a non-default-auth pool. Querying
a non-default pool -- e.g. getNumBusyConnections( "steve", "test" ) -- will
throw an Exception if no Conections have ever been requested for ("steve", "test")
rather than initializing a new pool. [Thanks to Jiji Sasidharan for calling
attention to this issue.]
-- Finally rationalized C3P0Registry's Object retention policy. C3P0Registry
retains references to all C3P0 DataSources, to provide a central
point of client access for users, and to ensure that multiple JNDI
lookups within a single VM result in the same DataSource instance.
This is both intuitive, and avoids multiplying Threads and pools.
In previous versions of c3p0, hard references were retained indefinitely.
Closed DataSources hold no non-memory resources, and are small Objects,
but in unusual scenarios wherein very many c3p0 DataSources are created
and destroyed within the lifetime of a single VM, this amounts to a
memory leak. C3P0Registry now retains hard references to DataSources
so long as they have not been close()ed (or DataSources.destroy()ed).
When they have been close()ed, only weak references to c3p0 DataSources
persist, and they are eligible for garbage collection. [Thanks to
Jeremy Grodberg for calling attention to this as a real-world issue.]
-- Removed some of the new pool stat params which distractingly appear in
ComboPooledDataSource's toString() method (and c3p0 pools' config dump).
c3p0-0.9.1-pre10
-- Exposed statement pool stats via PooledDataSource interface and MBean.
Added accessors to the statement cache, pool, pool manager, and
AbstractPoolBackedDataSource.
-- Fixed a bug whereby multiple near-simultaneous Connection requests failed
to provoke sufficient pool growth/Connection acquisition. This is a bug
reintroduced in c3p0-0.9.1-pre4, and is a duplicate of an early issue,
resolved under the old pool size management scheme. c3p0 must (and does)
keep track not only of its current size and pending growth, but also the
number of potentially unserved recent Connection requests. c3p0-0.9.1-pre4
thru c3p0-0.9.1-pre9 failed to make use of the incoming request count when
deciding whether and how much to grow the pool. Many thanks to John Kristian
for calling attention to this subtle issue.
-- Exposed information about Connection test failures (failure count of
each type of test, stack trace of last failure and last failure of each
type) via the PooledDataSource interface and its assiciated MBean.
-- Fixed a rare situation where a Connection test on check-out could
be performed by a Thread holding the pool's lock, if an initial
attempt to checkout a Connection failed and a second checkout attempt
is initiated internally. The recursive checkout is now performed
without the pool's lock.
-- Established a consisent policy re logging of Connection test failures.
They are now logged at FINE level (DEBUG under log4j). Previously tests
on checkin and checkout were logged at FINE, but idle tests were logged
at INFO. Is it worth letting this be configurable, as some users may prefer
to see test failures under normal operation?
-- Modified C3P0PooledConnectionPoolManager to perform a trial Connection
acquisition before trying to establish a pool, as pools established
on bad database or authentification information churn indefinitely trying
to acquire minPoolSize Connections, clogging up the thread pool and
sometimes leading to "APPARENT DEADLOCKS" if users touch a pool with
bad authentification information.
-- Defined UnifiedConnectionTester (and AbstractConnectionTester) so that
ConnectionTesters can provide any Exception associated with a failure,
which will show up as the "root cause" of the Exception eventually
thrown to signal the failure.
-- Added logging at WARNING level when a Connection tester reports the
database is invalid, triggering a reset of the Connection pool.
c3p0-0.9.1-pre9
-- Updated the documentation. It is now fully current.
-- Changed the name of the jboss configuration mbean from
com.mchange.v2.c3p0.mbean.C3P0PooledDataSource to com.mchange.v2.c3p0.jboss.C3P0PooledDataSource,
in order to distinguish the jboss configuration stuff from the normal management
beans, which really are quite different. The old com.mchange.v2.c3p0.mbean.C3P0PooledDataSource
still exists, so that existing users don't see anything break, but only the new version will
be updated to support new parameters.
-- Added a means by which users can suppress JMX MBean registration if they
wish. Setting the property com.mchange.v2.c3p0.management.ManagementCoordinator
to com.mchange.v2.c3p0.management.NullManagementCoordinator will
prevent mbean registration. (Advanced users can also use this to install
their own implementations of the ManagementCoordinator interface, though
I doubt many people will find this useful.)
-- Fixed infinitely loop in ComboPooledDataSource.setFactoryClassLocation( ... ) [introduced with
the reorganization of ComboPooledDataSource to inherit from AbstractPoolBackedDataSource (?)]
-- Added some code to warn on common spelling errors of c3p0.properties
and c3p0-config.xml (Users have frequently mistaken the digit 0 for
the letter O in c3p0.)
-- Wrote a DynamicMBean for PooledDataSources. It seems to work,
covers both ComboPooledDataSource and "wrapping" PoolBackedDataSources,
and should cover new config parameters and accessors automatically.
-- More refinements to connection test logic. We test proxy Connections
when there's a statement cache and a test query (to save time, since
the test query is likely cached), we test physical connections if we'll
need to do the slow, default test (statement caching doesn't help), or
if there is no statement cache.
-- Removed the stub servlet I'd previously added. Although it jdk1.5+, the
JMX approach is a better one for monitoring and modifying c3p0 pools at
runtime, and I'm going to focus on that for now. (If there's a lot of
clamor for it, I'll add back and flesh out the servlet. It just doesn't
seem like a great use of my time for now.)
-- Modified build to create a separate jdk1.3 compatable jar by stripping
source of lines beginning with "assert". I want to start using assertions,
but will keep them to recognizable, strippable one-liners.
-- Modified DriverManagerDataSource to handle its driverClass parameter
in a less fragile way. Rather than attempting to load the driverClass on
property set, DriverManagerDataSource now lazily tries to load the class
upon its first call to getConnection() after the property is initialized
or updated.
c3p0-0.9.1-pre8
-- Fixed bug whereby jdbcUrl and driverClass were not initialized properly
if set in config files rather than in code. [Thanks to Felipe Dominguez
for calling attention to this problem!]
-- Changed AbstractPoolBackedDataSource from a non-public class in
com.mchange.v2.c3p0 to a public class in com.mchange.v2.c3p0.impl to
workaround fragilities associated with sun bug id #6342411, wherein
reflective invocation of public methods on a non-public class fail,
even when involed via a public base-class.
-- Fixed NullPointerException (introduced on -pre7) on initializing with
a named config.
-- Continuing along the same lines, modified C3P0Registry and
C3P0ManagementCoordinator to unregister (both from C3P0Registry and
associated MBeans on DataSource close. When all PooledDataSources
are unregistered, the C3P0RegistryManager MBean unregisters as well.
-- Modified ActiveManagementCoordinator to check for, and unregister, the
C3P0Registry mbean prior to registration, to prevent conflicts on
undeploy/redepoloy cycle. [Thanks to Ben Groeneveld for calling attention
to this problem, and suggesting the fix.]
-- Modified C3P0PooledConnectionPool to perform Connection tests on the raw
physical Connection rather than the proxy Connection, when possible (i.e.
when we're using a C3P0 PooledConnection implementation that we know how to
get underneath of). This is better because 1) it's slightly faster; 2) it's
significantly faster on failure, as C3P0 PooledConnections test Connections
after a failure with statusOnException(), leading to an unnecessary
double-check; and 3) authors of custom ConnectionTesters can use vendor-specific
API to test Connections if they wish.
c3p0-0.9.1-pre7
-- Defined the ConnectionCustomizer interface as a hook through which clients
can "set up" newly acquired or checked out connections (and clean up prior
to check-in or destruction). Added config param connectionCustomizerClassName.
-- Formerly unused config parameter propertyCycle now controls how frequently
c3p0 checks timestamps against expiration parameters (maxIdleTime,
maxIdleTimeExcessConnections, maxConnectionAge, unreturnedConnectionTimeout)
-- Added config parameters unreturnedConnectionTimeout and
debugUnreturnedConnectionStackTraces, reluctantly but by popular demand.
If unreturnedConnectionTimeout is set, Connections will be automatically
destroyed and removed from the pool if not returned in the given number
of seconds. If debugUnreturnedConnectionStackTraces is also set, stack
traces will be captured on check-out of any Connection, and the stack traces
that were unreturned and cleaned up by the pool will be logged. Any clean-up
of an unreturned Connection is logged at INFO level, in hopes of annoying
people into cleaning up their code and close()-ing their Connections reliably.
-- Added config parameter maxIdleTimeExcessConnections. Connections in excess of
the pool's minimum size will be expired out if they remain idle for longer
than maxIdleTimeExcessConnections. [Thanks to Navin M. and Ben Groeneveld for
the suggestion.]
-- Added configuration parameter maxConnectionAge to limit the absolute age
of Connections (age in seconds from acquisition, rather than in seconds
form last check-in).
-- Put more status accessors in ThreadPoolAsynchronousRunner and exposed
thread pool state via JMX (PooledDataSourceManagerMBean).
-- Preliminary support for management via mbeans/jmx under jdk1.5+ is
implemented. (These mbeans are distinct from the mbean designed for
configuring c3p0 under jboss, and are in the package
com.mchange.c3p0.management.) Currently, pool statistics are instrumented,
as well as pool reset operations, but viewing and modifying the pool
configuration parameters is not supported. (I'll write a dynamic mbean to
capture this stuff; there are too many config properties I'm already
updating by hand in too many places. Later.) [Thanks to Ben Groeneveld for
the suggestion, including some nice sample code!]
-- Added configuration parameter maxAdministrativeTaskTime, which forces
interrupt() to be called on pool administrative tasks (Connection acquisition,
destruction and testing; prepared statement destruction) if these tasks seem
to hang. This is one strategy for dealing with database that hang and lead to
deadlock messages and eventually large memory footprints. It's useful only if
the hanging operations respond to interrupt()s, not thread-monitor related
deadlocks (which hopefully don't ever happen). c3p0 should recover from any
Exceptions provoked by the interrupt() calls. (Hopefully improvements to
GooGooStatementCache have rendered this parameter largely unnecessary by
resolving the most common source of deadlocks.)
-- Major revision to GooGooStatementCache that may eliminate most APPARENT
DEADLOCK messages. c3p0-0.9.0 introduced a complicated implementation
of closeAll(), in order to ensure that Statement and Connection close did
not happen simultaneously. Upon review, there was a significant bug in the
implementation, and even when corrected, the strategy is itself prone to
deadlocks should the ThreadPool become saturated with destroy tasks, which
block awaiting statement remove tasks. Rewrote closeAll() as a simple
synchronous method, rather than simulating synchrony with wait()/notifyAll(),
but with care not to hold the StatementCache's lock during Statement.close()
calls. There is a slight loss of asynchrony, as Statement.close() methods
are executed sequentially rather than simultaneously, but as a practical
matter, since the sequential destruction occurs asynchronously in the
thread pool and is invisible to clients, both client-observed and over-all
performance should not suffer. (It may even be improved, as the 0.9.0.x
strategy was complicated and had some overhead.) Note: This revision should
also eliminate occasional ConcurrentModificationExceptions associated
with the Statement cache.
-- Changed asynchronous tasks implemented as anonymous inner classes to named
inner classes, so that users reviewing active and pending tasks (usually
in trying to make sense of an APPARENT DEADLOCK) have a better idea of
what's going on.
-- Major revision to GooGooStatementCache that may eliminate most APPARENT
DEADLOCK messages. c3p0-0.9.0 introduced a complicated implementation
of closeAll(), in order to ensure that Statement and Connection close did
not happen simultaneously. Upon review, there was a significant bug in the
implementation, and even when corrected, the strategy is itself prone to
deadlocks should the ThreadPool become saturated with destroy tasks, which
block awaiting statement remove tasks. Rewrote closeAll() as a simple
synchronous method, rather than simulating synchrony with wait()/notifyAll(),
but with care not to hold the StatementCache's lock during Statement.close()
calls. There is a slight loss of asynchrony, as Statement.close() methods
are executed sequentially rather than simultaneously, but as a practical
matter, since the sequential destruction occurs asynchronously in the
thread pool and is invisible to clients, both client-observed and over-all
performance should not suffer. (It may even be improved, as the 0.9.0.x
strategy was complicated and had some overhead.)
-- Users still occasionally report seeing "APPARENT DEADLOCK" messages
from ThreadPoolAsynchronousRunner. Previously, most reports had to
do with cached PreparedStatements that hang when closed. Previous
fixes (in 0.9.0) seemed to resolve these problems. Most new reports
have to do with Connection acquisition or Connection close() tasks
hanging indefinitely, with statement cacheing not necessarily involved.
It's unclear whether these reports stem from a c3p0 bug, or rare
situations in which various JDBC driver hangs hang c3p0. (If the
condition is temporary, c3p0 recovers after the "APPARENT DEADLOCK"
warning. In any case, ThreadPoolAsynchronousRunner has been modified
to provide much better debug information, particularly in jdk1.5
environments, where hung Thread stack traces are dumped.
-- Modified the build file and refactored C3P0Config / C3P0ConfigUtils / C3P0ConfigXmlUtils
to make sure that c3p0 still runs under jdk1.3, even though it only builds
under jdk 1.5. JMX support is 1.5 only, and XML config depends on the
availability of standard XML extensions under jdk 1.3. (This is going to get harder,
as I hope to start using assertions. For the moment, assertions are
commented out. I think I'll have ant filter away the assertions for 1.3
builds and leave them in otherwise, based on a build property.
-- Significantly reorganized (hopefully simplified) of C3P0Registry and
ComboPooledDataSource. Much of the complication of all this is supporting
the most annoying, least used, but nevertheless very important feature
of supporting JNDI lookups across JVM boundaries via Serialization or JNDI
References.
-- Reorganized ComboPooledDataSource to inherit from PoolBackedDataSource.
In doing so, changed setConnectionPoolDataSource() of PoolBackedDataSource
to throw a PropertyVetoException. (It is a "constrained property" now.)
The very, very few users who call this method directly may have to update
their code to handle the potential Exception. This change does not affect
compatability for clients that use ComboPooledDataSource or who create
PoolBackedDataSources via the c3p0's factories (e.g. DataSources).
-- Fixed bug whereby config parameter breakAfterAcquireFailure did not take
effect at the ResourcePool level.
-- Fixed bug whereby initialPoolSize parameter failed to take effect at the
ResourcePool level.
-- Fixed a bug whereby Connection tests on checkout held the pool's lock,
preventing other activity during the Connection test. [Thanks to John
Sumsion for calling attention to this subtle problem.]
-- ThreadPoolAsynchronousRunner has seen some minor efficiency improvements
(a task that calls interrupt() long-running tasks on post-deadlock blocked,
replaced threads no longer runs when there are no post deadlock blocked,
replaced threads).
-- Previous versions used a Stringified identityHashCode() as a unique ID
for various C3P0 objects. This was not correct (and bit at least one
user in practice), as identityHashCode()s are not guaranteed unique,
and in practice are not on 64-bit VMs. c3p0 now checks identityHashCodes
to make sure they are not reused, and if seen before appends a count to
keep unique IDs unique. [Many thanks to Prishan Makandurage for calling
attention to this issue.]
-- Fixed fact that statusOnException() in NewPooledConnection() ignored
preferredTestQuery parameter, always using the very slow default
connection test rather than the user-defined test. [Thanks to Andrea
Luciano for calling attention to this issue.]
-- C3P0PooledConnection (part of the "traditionalReflectiveProxies"
codebase that's largely been superceded, but that is still nominally
supported) held a static reference to a ClassLoader, in some cases
preventing the ClassLoader from being garbage collected (for example
when webapp contexts, with context specific Classloaders are
undeployed by some app servers). This was entirely unnecessary, as
the cached reference was used exactly once in the lifecycle of the
class. The reference to the ClassLoader is no longer stored. [Many
thanks to Michael Fortin for very specifically tracking down this
subtle problem!]
-- Added logic to log individual acquisition failures at INFO level
if acquireRetryAttempts <= 0. if num_acq_attempts <= 0, we try to
acquire forever, so the end-of-batch log message below will never
be triggered if there is a persistent problem so in this case,
it's better flag a higher-than-debug-level message for
each failed attempt. [Thanks to Eric Crahen for calling attention
to this issue.]
c3p0-0.9.1-pre6
-- Wrote a stub of a status-monitoring servlet. Not yet documented, or
even usefully functional, but hopefully will be soon.
-- Updated documentation to include new config file format, including
named and per-user config. Docs could still use some work, but the
functionality is now described.
-- For consistency, the parameters user and password are now configurable