JiveJdon Community Forums
在线395人   首页   主题表   培训咨询   标签   精华   查搜   注册    登陆 RSS
首页 » 论坛 » 开源项目大家谈
???en_US.forumThreadPrev.name??? 上一主题
  Go back to the topic 返回本主题   Go back to the topic listing返回主题列表
???en_US.forumThreadNext.name??? 下一主题
Go 总共有 0 回复 / 1
 发表新帖子   回复该主题贴
shineyear

悄悄话
发表文章: 15
注册时间: 2005年02月01日 01:33
hibernate 时好时坏的问题,急!!! 2005年02月11日 15:19 到本帖网址 加入本帖到收藏夹 发送到手机 回复该主题
标签列表
我使用了Struts+hibernate+jboss+WIN2K+MYSQL的环境
在制作用户注册与用户登陆的过程中发生了很奇怪的现象
程序制作完成后启动JBOSS,运行注册用户的程序,成功向数据库中添加了数据,之后运行登陆程序也可以成功登陆,在JBOSS的DOS窗口显示正常,查询语句全都能显示并运行。
但当我关闭JBOSS,30秒后重新启动JBOSS,运行注册程序,JBOSS的DOS窗口中无任何错误显示,但就是无法向数据库中插入数据,之后运行登陆页面,以前验证成功的用户名全部无效,无法正常验证,查看DOS中仍无任何错误信息,而且所有的HQL语句都不做显示
关闭JBOSS 大概5分钟左右,再次启动,一切恢复正常,日~~~
循环以上情况
请问高手是何原因,如何解决?
这个问题已经困扰我多日,请指教!

注册程序如下:
public void Addnew(RegForm regform) throws HibernateException {
try{

Session session = beginTransaction();
userinfo appuser2 = new userinfo();
MD5 myMD5 = new MD5();
String name=regform.getUsername().trim();
if(name!=null && name!="" && name.length()<20){


regform.setUsername(name);

regform.setPasswd(myMD5.getMD5ofStr(regform.getPasswd()));
regform.setRegtime(gettime());
BeanUtils.copyProperties(appuser2,regform);

session.save(appuser2);
session.flush();
}

endTransaction(true);
}catch(Exception e){
endTransaction(false);
}


}




登陆验证程序如下:

public userinfo findByUser(String username) throws HibernateException {
userinfo appuser = null;

Session ss = DBManager.getSession();
try{
appuser = (userinfo) ss.load(userinfo.class,username);
}catch (Exception e){
appuser = null;
}
ss.close();
return appuser;
}

这个主题有 0 回复 / 1Go
???en_US.forumThreadPrev.name??? 上一主题
  Go back to the topic 返回本主题   Go back to the topic listing返回主题列表    返回页首返回页首
???en_US.forumThreadNext.name??? 下一主题
热点TAG: AOP cache 缓存 DDD EJB 集群 设计模式 Hibernate IOC JiveJdon OO RBAC Seam Spring Struts
正在读取,请等待...
google yahoo 新浪ViVi 365Key网摘 天极网摘 CSDN网摘 添加到百度搜藏 POCO网摘 博采网摘
查询本论坛内 回复超过的热门帖子
     回复该主题贴
标题
 
粗体 斜体 下划线 插入图片 插入代码 插入url链接 插入附件
内容
  发贴前查询 标签列表勿重复发表问题

RSS 手机阅读 add to google add to yahoo
解惑之道在J道 ,打造中国最具影响力的的企业软件社区
OpenSource JIVEJDON v3.0 Powered by JdonFramework Code © 2002-08 jdon.com
anti spam