首页新闻找找看学习计划

NHibernate 刪除記錄時異常

0
悬赏园豆:80 [已解决问题] 解决于 2013-08-20 15:11

Initializing[PAT.Dao.Domain.LicenseZone#1]-Illegally attempted to associate a proxy with two open Sessions

表MAP:

<?xml version="1.0" encoding="utf-8"?>
<hibernate-mapping assembly="PAT.Dao" namespace="PAT.Dao.Domain" xmlns="urn:nhibernate-mapping-2.2">
  <class name="Paid" table="PAT_PAID" schema="PATENT">
    <id name="ID" type="Decimal">
      <column name="ID" not-null="true" scale="0" sql-type="NUMBER" />
      <generator class="sequence">
        <param name="sequence">PAT_Seq_Paid</param>
      </generator>
    </id>
    <property name="UniPatentID" type="String">
      <column name="UNIPATENTID" not-null="true" length="50" sql-type="NVARCHAR2" />
    </property>
    <property name="PatentID" type="String">
      <column name="PATENTID" not-null="true" length="50" sql-type="NVARCHAR2" />
    </property>
    <property name="Name" type="String">
      <column name="NAME" not-null="false" length="50" sql-type="NVARCHAR2" />
    </property>
    <property name="IssuedDate" type="DateTime">
      <column name="ISSUEDDATE" not-null="false" sql-type="DATE" />
    </property>
    <property name="GotInformDate" type="DateTime">
      <column name="GOTINFORMDATE" not-null="false" sql-type="DATE" />
    </property>
    <property name="SpecifiedPayAmount" type="Decimal">
      <column name="SPECIFIEDPAYAMOUNT" not-null="false" scale="0" sql-type="NUMBER" />
    </property>
    <property name="ActualPayAmount" type="Decimal">
      <column name="ACTUALPAYAMOUNT" not-null="false" scale="0" sql-type="NUMBER" />
    </property>
    <property name="SpecifiedPayDate" type="DateTime">
      <column name="SPECIFIEDPAYDATE" not-null="false" sql-type="DATE" />
    </property>
    <property name="ActualPayDate" type="DateTime">
      <column name="ACTUALPAYDATE" not-null="false" sql-type="DATE" />
    </property>
    <property name="GotReceiptDate" type="DateTime">
      <column name="GOTRECEIPTDATE" not-null="false" sql-type="DATE" />
    </property>
    <property name="Note" type="String">
      <column name="NOTE" not-null="false" length="255" sql-type="NVARCHAR2" />
    </property>
    <property name="CreateDate" type="DateTime">
      <column name="CREATEDATE" not-null="true" sql-type="DATE" />
    </property>
    <property name="CreateUser" type="Decimal">
      <column name="CREATEUSER" not-null="true" scale="0" sql-type="NUMBER" />
    </property>
    <property name="ModifyDate" type="DateTime">
      <column name="MODIFYDATE" not-null="false" sql-type="DATE" />
    </property>
    <property name="ModifyUser" type="Decimal">
      <column name="MODIFYUSER" not-null="false" scale="0" sql-type="NUMBER" />
    </property>
    <many-to-one name="License" class="License" update="false" insert="false" property-ref="UniPatentID">
      <column name="UNIPATENTID" not-null="false" length="50" sql-type="NVARCHAR2" />
    </many-to-one>
    <many-to-one name="LicenseZone" class="LicenseZone">
      <column name="ZONEID" not-null="true" scale="0" sql-type="NUMBER" />
    </many-to-one>
  </class>
</hibernate-mapping>
View Code
eesee的主页 eesee | 初学一级 | 园豆:136
提问于:2013-08-20 14:31
< >
分享
最佳答案
0

設置 lazy="false"

eesee | 初学一级 |园豆:136 | 2013-08-20 15:10
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册