NHibernate:could not initialize a collection
报错场景是这样的:数据库有两个表:InstructionOrder和InstructionOrderLine,是一对多的关系,InstructionOrderLine有外键head_id,head_id是InstructionOrder的主键id,我读取InstructionOrder的数据,然后将其插入到另外一个数据库中,然后偶尔就会报以下错误,但是第二次又会处理成功,一直没找到原因,错误信息如下:could not initialize a collection: [InstructionOrder.InstructionOrderLineshead_#41909][SQL: SELECT instructio0_.head_id as head18_1_, instructio0_.id as id1_, instructio0_.id as id39_0_, instructio0_.part_code as part2_39_0_, instructio0_.part_name as part3_39_0_, instructio0_.category as category39_0_, instructio0_.repair_property as repair5_39_0_, instructio0_.length as length39_0_, instructio0_.width as width39_0_, instructio0_.high as high39_0_, instructio0_.weight as weight39_0_, instructio0_.price as price39_0_, instructio0_.plan_qty as plan11_39_0_, instructio0_.act_qty as act12_39_0_, instructio0_.business_line_id as business13_39_0_, instructio0_.remark as remark39_0_, instructio0_.second_category as second15_39_0_, instructio0_.line_status as line16_39_0_, instructio0_.business_line_code as business17_39_0_, instructio0_.head_id as head18_39_0_ FROM InstructionOrderLine instructio0_ WHERE instructio0_.head_id=?]
...全文
相关推荐
Abp.NHibernate连接PostgreSQl数据库的方法
(x => x.Id).GeneratedBy.Increment(); Map(x => x.Name); References<userModel>(a => a.Id).Not.LazyLoad(
nhibernate教程
- 可以使用SQL语句手动创建表,例如创建学生表: ```sql CREATE TABLE Student ( StudentId int identity(1,1) PRIMARY KEY NOT NULL
nhibernate_reference.rar_NHibernate_NHibernate Referen
**集合映射(Collection Mapping)**:支持多种集合类型,如 List、Set 和 Bag。4. **级联操作(Cascading)**:自动将对父实体的操作应用于子实体。5.
Summer of Nhibernate Session 02a Code.zip
《Nhibernate实战:Summer of Nhibernate Session 02a Code深度解析》在编程领域,Nhibernate作为一个强大的对象关系映射(ORM)框架,为.NET开发者提供了便捷的数据持久化解决方案
NHibernate.chm
**集合映射(Collection Mapping)**: NHibernate支持多种集合类型(如List、Set、Bag等)的映射,以及一对一、一对多、多对多等复杂关联关系的处理。11.


