NHibernate:could not initialize a collection

_懒猫 _懒猫 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
报错场景是这样的:数据库有两个表: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=?]
...全文

相关推荐

评论 4
收藏 已收藏
分享
返回顶部
_懒猫
C# 111,129 成员 642,538 内容