开发中遇到的错误记录 1.     错误:could not execute query… 2.     错误Could not initialize proxy-no Session 3.     错误no session or session was closed 4.     错误编译时文件被占用错误 5.     js相关

2014-8-5 09:24:11

除了可能是查询语句写错了;另外一个可能是Schema不对。

解决办法:要么查询语句的表名加上Schema,但这样比较麻烦。另一种办法:可以在数据库中建一个用户,默认Schema为该数据库用的Schema,然后连接字符串使用该用户。

2.     错误Could not initialize proxy-no Session

2014-8-6 10:11:11

错误如下图:

开发中遇到的错误记录
1.     错误:could not execute query…
2.     错误Could not initialize proxy-no Session
3.     错误no session or session was closed
4.     错误编译时文件被占用错误
5.     js相关 

解决办法:这是NHibernate配置问题,将对应的Domain.hbm.xml(Mapping)文件里对应的字段配置添加lazy=”false”,比如: <many-to-one name="AppDivision" column="ApplicationId" class="AppDivision" lazy="false" not-null="true" />。

可参加博客:http://blog.csdn.net/remote_roamer/article/details/2934437

3.     错误no session or session was closed

2014-8-6 10:21:33

错误如下图:

 开发中遇到的错误记录
1.     错误:could not execute query…
2.     错误Could not initialize proxy-no Session
3.     错误no session or session was closed
4.     错误编译时文件被占用错误
5.     js相关

解决办法:参照问题2

4.     错误编译时文件被占用错误

报错信息:

Error 6 Unexpected error creating debug information file 'D:ProjectEland.EOASsrcmainCommonEland.EOAS.Win.CommonobjDebugEland.EOAS.Win.Common.PDB' -- 'D:ProjectEland.EOASsrcmainCommonEland.EOAS.Win.CommonobjDebugEland.EOAS.Win.Common.pdb: The process cannot access the file because it is being used by another process.

' Eland.EOAS.Win.Common

解决办法:改变启动项目

5.     js相关

当你发现不同的对象之间好像产生了关联影响。那么看一下你的变量前面是否加了var,否则该变量是个全局变量,你所认为的不同对象变成了一个对象。

(注:在做messageBox时,发现弹出的不同框之间相互影响,好像是在操作一个弹出框一样,后来发现创建的div的变量没有用var修饰)