dims 2002/09/25 12:26:31
Modified: java/src/org/apache/axis/encoding/ser
BaseDeserializerFactory.java
BaseSerializerFactory.java
Log:
Fix for Bug 12741 caused performance degradation....as the getSerializerMethod and
getDeserializer method's were getting called multiple times under heavy load....Adding
a synchronized keyword to prevent this problem.
Revision Changes Path
1.9 +5 -2
xml-axis/java/src/org/apache/axis/encoding/ser/BaseDeserializerFactory.java
Index: BaseDeserializerFactory.java
===================================================================
RCS file:
/home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/BaseDeserializerFactory.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- BaseDeserializerFactory.java 17 Sep 2002 22:55:47 -0000 1.8
+++ BaseDeserializerFactory.java 25 Sep 2002 19:26:31 -0000 1.9
@@ -165,8 +165,11 @@
*/
protected Deserializer getSpecialized(String mechanismType) {
if (javaType != null && xmlType != null) {
- if (getDeserializer == null) {
- getDeserializer = getDeserializerMethod(javaType);
+ // Ensure that getDeserializerMethod is called only once.
+ synchronized (this) {
+ if (getDeserializer == null) {
+ getDeserializer = getDeserializerMethod(javaType);
+ }
}
if (getDeserializer != null) {
try {
1.17 +5 -2
xml-axis/java/src/org/apache/axis/encoding/ser/BaseSerializerFactory.java
Index: BaseSerializerFactory.java
===================================================================
RCS file:
/home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/BaseSerializerFactory.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- BaseSerializerFactory.java 25 Sep 2002 18:27:03 -0000 1.16
+++ BaseSerializerFactory.java 25 Sep 2002 19:26:31 -0000 1.17
@@ -190,8 +190,11 @@
*/
protected Serializer getSpecialized(String mechanismType) {
if (javaType != null && xmlType != null) {
- if (getSerializer == null) {
- getSerializer = getSerializerMethod(javaType);
+ // Ensure that getSerializerMethod is called only once.
+ synchronized (this) {
+ if (getSerializer == null) {
+ getSerializer = getSerializerMethod(javaType);
+ }
}
if (getSerializer != null) {
try {