Commit 2a0d5011 authored by Matt Tucker's avatar Matt Tucker Committed by matt

Fixed proxy exception handling to return true error.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@6115 b35dd754-fafc-0310-a699-88a17e54d16e
parent cf128584
...@@ -15,6 +15,7 @@ import java.sql.Connection; ...@@ -15,6 +15,7 @@ import java.sql.Connection;
import java.sql.SQLException; import java.sql.SQLException;
import java.lang.reflect.InvocationHandler; import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
/** /**
* An implementation of the Connection interface that wraps an underlying * An implementation of the Connection interface that wraps an underlying
...@@ -102,8 +103,13 @@ public class ConnectionWrapper { ...@@ -102,8 +103,13 @@ public class ConnectionWrapper {
} }
else { else {
// Invoke the method normally if all else fails. // Invoke the method normally if all else fails.
try {
return method.invoke(connection, args); return method.invoke(connection, args);
} }
catch (InvocationTargetException ite) {
throw ite.getCause();
}
}
} }
/** /**
......
...@@ -15,6 +15,7 @@ import java.sql.*; ...@@ -15,6 +15,7 @@ import java.sql.*;
import java.util.*; import java.util.*;
import java.lang.reflect.InvocationHandler; import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
/** /**
* Wraps a Connection object and collects statistics about the database queries * Wraps a Connection object and collects statistics about the database queries
...@@ -666,8 +667,13 @@ public class ProfiledConnection implements InvocationHandler { ...@@ -666,8 +667,13 @@ public class ProfiledConnection implements InvocationHandler {
} }
else { else {
// Invoke the method normally if all else fails. // Invoke the method normally if all else fails.
try {
return method.invoke(connection, args); return method.invoke(connection, args);
} }
catch (InvocationTargetException ite) {
throw ite.getCause();
}
}
} }
/** /**
...@@ -736,8 +742,13 @@ public class ProfiledConnection implements InvocationHandler { ...@@ -736,8 +742,13 @@ public class ProfiledConnection implements InvocationHandler {
} }
// Invoke the method normally if all else fails. // Invoke the method normally if all else fails.
try {
return method.invoke(stmt, args); return method.invoke(stmt, args);
} }
catch (InvocationTargetException ite) {
throw ite.getCause();
}
}
} }
/** /**
...@@ -858,8 +869,13 @@ public class ProfiledConnection implements InvocationHandler { ...@@ -858,8 +869,13 @@ public class ProfiledConnection implements InvocationHandler {
} }
// Invoke the method normally if all else fails. // Invoke the method normally if all else fails.
try {
return method.invoke(pstmt, args); return method.invoke(pstmt, args);
} }
catch (InvocationTargetException ite) {
throw ite.getCause();
}
}
} }
/** /**
...@@ -980,7 +996,12 @@ public class ProfiledConnection implements InvocationHandler { ...@@ -980,7 +996,12 @@ public class ProfiledConnection implements InvocationHandler {
} }
// Invoke the method normally if all else fails. // Invoke the method normally if all else fails.
try {
return method.invoke(cstmt, args); return method.invoke(cstmt, args);
} }
catch (InvocationTargetException ite) {
throw ite.getCause();
}
}
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment