{
checkExecStatus();
synchronized (getConnectionSynchronization())
{
//reason for casting is getActivationClass is not available on PreparedStatement
ExecPreparedStatement execp = (ExecPreparedStatement)preparedStatement;
setupContextStack(); // make sure there's context
try {
//bug 4579 - if the statement is invalid, regenerate the metadata info
if (preparedStatement.isValid() == false)
{
//need to revalidate the statement here, otherwise getResultDescription would
//still have info from previous valid statement
preparedStatement.rePrepare(lcc);
rMetaData = null;
}
//bug 4579 - gcDuringGetMetaData will be null if this is the first time
//getMetaData call is made.
//Second check - if the statement was revalidated since last getMetaData call,
//then gcDuringGetMetaData wouldn't match with current generated class name
if (gcDuringGetMetaData == null || gcDuringGetMetaData.equals(execp.getActivationClass().getName()) == false)
{
rMetaData = null;
gcDuringGetMetaData = execp.getActivationClass().getName();
}
if (rMetaData == null)
{
ResultDescription resd = preparedStatement.getResultDescription();
if (resd != null)