Redian新闻
>
发现weblogic 8.1 workshop一个bug
avatar
发现weblogic 8.1 workshop一个bug# Java - 爪哇娇娃
t*k
1
int ret;
...
//ret的值是1,当然上面还有好多语句
//但下的if语句和我程序是一模一样的
//没有删减
if (ret == 1)
{
con.commit(); //1
}
else
{
con.rollback(); //2
}
按道理,ret为1,那只会执行语句1,不会执行2
但我debug时,weblogic执行完1后,又执行了2
看的我目灯口呆
还怀疑自己对语法不清楚
...
上面的语句是session bean的
另外,以前也发现在我写的session bean中
为了关闭数据库有些东西,如关闭PrepareStatement,ResultSet之类的东西
特别有finally
但在有些方法中,程序会去运行finally里的语句
而有些方法中,运行了return后(return是在try里的),不会去运行finally里的语句
而且就停在那了
真是莫名啊
avatar
m*t
2
Are you sure it's actually executing the code in that way, or just the
debugger is messed up when you are stepping through (e.g. the source code is
out of date).
Another thought is, AFAIK, weblogic 8.1 uses JRockIt as the default VM. But
still it's hard to believe it would screw up fundamentals like this.

【在 t********k 的大作中提到】
: int ret;
: ...
: //ret的值是1,当然上面还有好多语句
: //但下的if语句和我程序是一模一样的
: //没有删减
: if (ret == 1)
: {
: con.commit(); //1
: }
: else

avatar
t*k
3
重新debug了一次
运行条真的去了2
但换成另外一条语句
好象未执行
但运行条不该到else里面的啊

【在 m******t 的大作中提到】
: Are you sure it's actually executing the code in that way, or just the
: debugger is messed up when you are stepping through (e.g. the source code is
: out of date).
: Another thought is, AFAIK, weblogic 8.1 uses JRockIt as the default VM. But
: still it's hard to believe it would screw up fundamentals like this.

avatar
t*s
4
Are you sure that the source is match the compiled JVM code?

【在 t********k 的大作中提到】
: 重新debug了一次
: 运行条真的去了2
: 但换成另外一条语句
: 好象未执行
: 但运行条不该到else里面的啊

avatar
t*k
5
应该不会有,贴出我的原程序吧
private String insertBulletin(BulletinInfo bulletinInfo) throws
ErrorMessage
{
int ret;
String unid;
sql = "SELECT seq_bulletin.nextval FROM DUAL";

if (bulletinInfo == null)
{
return null;
}

try
{
stm = con.createStatement();
rs = stm.executeQuery(sql);
rs.next();
unid = rs.getString(1);
bulletinInfo.setUnid(unid);
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。