FULL PRODUCT VERSION :
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
The second time a CachedRowSetImpl is executed, its readonly flag (and some other information such as TransactionIsolation or MaxRows) is (are) forgotten.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
run the attached example.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
output:
false
false
flase
ACTUAL -
output:
false
false
true
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package ilog.views.util.data;
import java.sql.SQLException;
import javax.sql.rowset.CachedRowSet;
import com.sun.rowset.CachedRowSetImpl;
/**
* @author jolif
*
*/
public class RowSetPb3
{
final static String databaseURL = "jdbc:mysql:///ilog_demos";
final static String user = "";
final static String passwd = "";
final static String driverName = "com.mysql.jdbc.Driver";
final static String TABLE_NAME = "activities";
public RowSetPb3()
{
}
// CJO 12/04
public static void main(String[] arg)
throws Exception
{
new RowSetPb3().test();
}
public void test() throws ClassNotFoundException, InstantiationException,
IllegalAccessException, SQLException, InterruptedException
{
Class.forName(driverName);
CachedRowSet rowSet = new CachedRowSetImpl();
rowSet.setUrl(databaseURL);
rowSet.setUsername(user);
rowSet.setPassword(passwd);
rowSet.setCommand("select * from "+TABLE_NAME);
rowSet.setReadOnly(false);
System.out.println(rowSet.isReadOnly());
rowSet.execute();
System.out.println(rowSet.isReadOnly());
rowSet.execute();
System.out.println(rowSet.isReadOnly());
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
reset the value after second execute()
###@###.### 2004-12-15 17:43:50 GMT
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
The second time a CachedRowSetImpl is executed, its readonly flag (and some other information such as TransactionIsolation or MaxRows) is (are) forgotten.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
run the attached example.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
output:
false
false
flase
ACTUAL -
output:
false
false
true
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package ilog.views.util.data;
import java.sql.SQLException;
import javax.sql.rowset.CachedRowSet;
import com.sun.rowset.CachedRowSetImpl;
/**
* @author jolif
*
*/
public class RowSetPb3
{
final static String databaseURL = "jdbc:mysql:///ilog_demos";
final static String user = "";
final static String passwd = "";
final static String driverName = "com.mysql.jdbc.Driver";
final static String TABLE_NAME = "activities";
public RowSetPb3()
{
}
// CJO 12/04
public static void main(String[] arg)
throws Exception
{
new RowSetPb3().test();
}
public void test() throws ClassNotFoundException, InstantiationException,
IllegalAccessException, SQLException, InterruptedException
{
Class.forName(driverName);
CachedRowSet rowSet = new CachedRowSetImpl();
rowSet.setUrl(databaseURL);
rowSet.setUsername(user);
rowSet.setPassword(passwd);
rowSet.setCommand("select * from "+TABLE_NAME);
rowSet.setReadOnly(false);
System.out.println(rowSet.isReadOnly());
rowSet.execute();
System.out.println(rowSet.isReadOnly());
rowSet.execute();
System.out.println(rowSet.isReadOnly());
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
reset the value after second execute()
###@###.### 2004-12-15 17:43:50 GMT