Hi ,
I have a many-to-one mapping in my facilityContact.xml which maps to contactBean.xml . One fetching the records from the facilityContact (FAC_CONT) table an update is being fired on the contact (CONT) table. I really dont see why an update should be fired on the contact table since i have not created a new contact in my facilityContact pojo. This update stops the operation and locks the contact table. Does anyone have ne idea why an update is also being fired on a simple select ? The contactId is a foreign key from the contact table.
Hibernate version: 3.0
[b]Mapping documents: FacilityContactAssoc.hbm.xml hibernate-mapping>
<class name="com.phcs.first.business.association.facilitycontact.data.FacilityContactAssocBean" table="FAC_CONT"> <id name="facilityContactId" column="FAC_CONT_ID"> <generator class="increment"/> </id> <property name="facilityId" column="FAC_ID" update="true" insert="true" /> <property name="contactId" column="CONT_ID" update="true" insert="true" /> <property name="contactTypeId" column="CONT_TYP_ID" update="true" insert="true" /> <property name="contactRoleId" column="CONT_ROLE_ID" update="true" insert="true" /> <property name="facilityContactOtherRole" not-null="false" column="OTHER_ROLE_NAME" update="true" insert="true" /> <property name="statusId" column="STATUS_ID" update="true" insert="true" /> <property name="effectiveDate" column="EFF_DT" update="true" insert="true" /> <property name="terminationDate" column="TERM_DT" update="true" insert="true" /> <property name="terminationReason" column="TERM_REASON" not-null="true" update="true" insert="true" /> <property name="createdOnDate" column="CREATE_ON_DT" update="false" insert="true" /> <property name="createdByUser" column="CREATE_BY_USER" update="false" insert="true" /> <property name="modifiedOnDate" column="LAST_MOD_ON_DT" update="true" insert="true" /> <property name="modifiedByUser" column="LAST_MOD_BY_USER" update="true" insert="true" /> <many-to-one name="contactBean" class="com.phcs.first.business.contact.data.ContactBean" fetch="join" column="CONT_ID" unique="true" update="false" insert="false" /> </class>
</hibernate-mapping>
[b]Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using: oracle10g
[b]The generated SQL (show_sql=true):[12/28/05 21:54:50:665 IST] 0000003e Environment I Hibernate 3.0
[12/28/05 21:54:50:681 IST] 0000003e Environment I hibernate.properties not found
[12/28/05 21:54:50:681 IST] 0000003e Environment I using CGLIB reflection optimizer
[12/28/05 21:54:50:697 IST] 0000003e Environment I using JDK 1.4 java.sql.Timestamp handling
[12/28/05 21:54:51:056 IST] 0000003e Configuration I configuring from resource: /hibernate.cfg.xml
[12/28/05 21:54:51:056 IST] 0000003e Configuration I Configuration resource: /hibernate.cfg.xml
[12/28/05 21:54:51:384 IST] 0000003e Configuration I Mapping resource: ContactBean.hbm.xml
[12/28/05 21:54:51:556 IST] 0000003e HbmBinder I Mapping class: com.phcs.first.business.contact.data.ContactBean -> CONT
[12/28/05 21:54:51:665 IST] 0000003e Configuration I Mapping resource: EmailBean.hbm.xml
[12/28/05 21:54:51:665 IST] 0000003e HbmBinder I Mapping class: com.phcs.first.common.email.data.EmailBean -> MAIL_MASTER
[12/28/05 21:54:51:681 IST] 0000003e Configuration I Mapping resource: FacilityContactAssocBean.hbm.xml
[12/28/05 21:54:51:696 IST] 0000003e HbmBinder I Mapping class: com.phcs.first.business.association.facilitycontact.data.FacilityContactAssocBean -> FAC_CONT
[12/28/05 21:54:51:884 IST] 0000003e Configuration I Configured SessionFactory: null
[12/28/05 21:54:51:884 IST] 0000003e Configuration I processing extends queue
[12/28/05 21:54:51:884 IST] 0000003e Configuration I processing collection mappings
[12/28/05 21:54:51:900 IST] 0000003e Configuration I processing association property references
[12/28/05 21:54:51:900 IST] 0000003e Configuration I processing foreign key constraints
[12/28/05 21:54:51:993 IST] 0000003e Dialect I Using dialect: org.hibernate.dialect.OracleDialect
[12/28/05 21:54:52:040 IST] 0000003e SettingsFacto I Maximum outer join fetch depth: 1
[12/28/05 21:54:52:040 IST] 0000003e SettingsFacto I Default batch fetch size: 1
[12/28/05 21:54:52:040 IST] 0000003e SettingsFacto I Generate SQL with comments: disabled
[12/28/05 21:54:52:040 IST] 0000003e SettingsFacto I Order SQL updates by primary key: disabled
[12/28/05 21:54:52:056 IST] 0000003e SettingsFacto I Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
[12/28/05 21:54:52:071 IST] 0000003e ASTQueryTrans I Using ASTQueryTranslatorFactory
[12/28/05 21:54:52:087 IST] 0000003e SettingsFacto I Query language substitutions: {}
[12/28/05 21:54:52:103 IST] 0000003e DriverManager I Using Hibernate built-in connection pool (not for production use!)
[12/28/05 21:54:52:103 IST] 0000003e DriverManager I Hibernate connection pool size: 1
[12/28/05 21:54:52:118 IST] 0000003e DriverManager I autocommit mode: false
[12/28/05 21:54:52:134 IST] 0000003e DriverManager I using driver: oracle.jdbc.driver.OracleDriver at URL:
[12/28/05 21:54:52:134 IST] 0000003e DriverManager I connection properties:
[12/28/05 21:54:52:478 IST] 0000003e SettingsFacto I JDBC batch size: 15
[12/28/05 21:54:52:509 IST] 0000003e SettingsFacto I JDBC batch updates for versioned data: disabled
[12/28/05 21:54:52:556 IST] 0000003e SettingsFacto I Scrollable result sets: enabled
[12/28/05 21:54:52:556 IST] 0000003e SettingsFacto I JDBC3 getGeneratedKeys(): disabled
[12/28/05 21:54:52:571 IST] 0000003e TransactionFa I Using default transaction strategy (direct JDBC transactions)
[12/28/05 21:54:52:587 IST] 0000003e TransactionMa I No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
[12/28/05 21:54:52:587 IST] 0000003e SettingsFacto I Automatic flush during beforeCompletion(): disabled
[12/28/05 21:54:52:603 IST] 0000003e SettingsFacto I Automatic session close at end of transaction: disabled
[12/28/05 21:54:52:603 IST] 0000003e SettingsFacto I Cache provider: org.hibernate.cache.EhCacheProvider
[12/28/05 21:54:52:618 IST] 0000003e SettingsFacto I Second-level cache: enabled
[12/28/05 21:54:52:634 IST] 0000003e SettingsFacto I Optimize cache for minimal puts: disabled
[12/28/05 21:54:52:634 IST] 0000003e SettingsFacto I Structured second-level cache entries: enabled
[12/28/05 21:54:52:634 IST] 0000003e SettingsFacto I Query cache: disabled
[12/28/05 21:54:52:649 IST] 0000003e SettingsFacto I Echoing all SQL to stdout
[12/28/05 21:54:52:649 IST] 0000003e SettingsFacto I Statistics: disabled
[12/28/05 21:54:52:649 IST] 0000003e SettingsFacto I Deleted entity synthetic identifier rollback: disabled
[12/28/05 21:54:52:665 IST] 0000003e SettingsFacto I Default entity-mode: pojo
[12/28/05 21:54:52:962 IST] 0000003e SessionFactor I building session factory
[12/28/05 21:54:52:993 IST] 0000003e Configurator W No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: wsjar:file:/D:/PHCS/FIRST/code/FIRST/WebContent/WEB-INF/lib/ehcache-0.6.jar!/ehcache-failsafe.xml
[12/28/05 21:54:54:431 IST] 0000003e SessionFactor I Not binding factory to JNDI, no JNDI name configured
[12/28/05 21:54:54:446 IST] 0000003e SessionFactor I Checking 0 named queries
[12/28/05 21:54:54:555 IST] 0000003e SystemOut O got the dao 3
[12/28/05 21:54:54:587 IST] 0000003e SystemOut O Hibernate: select facilityco0_.FAC_CONT_ID as FAC1_1_, facilityco0_.FAC_ID as FAC2_2_1_, facilityco0_.CONT_ID as CONT3_2_1_, facilityco0_.CONT_TYP_ID as CONT4_2_1_, facilityco0_.CONT_ROLE_ID as CONT5_2_1_, facilityco0_.OTHER_ROLE_NAME as OTHER6_2_1_, facilityco0_.STATUS_ID as STATUS7_2_1_, facilityco0_.EFF_DT as EFF8_2_1_, facilityco0_.TERM_DT as TERM9_2_1_, facilityco0_.TERM_REASON as TERM10_2_1_, facilityco0_.CREATE_ON_DT as CREATE11_2_1_, facilityco0_.CREATE_BY_USER as CREATE12_2_1_, facilityco0_.LAST_MOD_ON_DT as LAST13_2_1_, facilityco0_.LAST_MOD_BY_USER as LAST14_2_1_, contactbea1_.CONT_ID as CONT1_0_, contactbea1_.CONT_FIRST_NAME as CONT2_0_0_, contactbea1_.CONT_LAST_NAME as CONT3_0_0_, contactbea1_.CONT_INTERNAL_EXTERNAL_FLG as CONT4_0_0_, contactbea1_.STATUS_ID as STATUS5_0_0_, contactbea1_.PHCS_TERR_ID as PHCS6_0_0_, contactbea1_.PHCS_LOC as PHCS7_0_0_, contactbea1_.CONT_TITLE as CONT8_0_0_, contactbea1_.CONT_LOC_ADDR_LINE_1 as CONT9_0_0_, contactbea1_.CONT_LOC_ADDR_LINE_2 as CONT10_0_0_, contactbea1_.CONT_LOC_ADDR_CITY as CONT11_0_0_, contactbea1_.CONT_LOC_ADDR_STATE as CONT12_0_0_, contactbea1_.CONT_LOC_ADDR_ZIP_CD as CONT13_0_0_, contactbea1_.CONT_LOC_ADDR_ZIP_CD_4 as CONT14_0_0_, contactbea1_.CONT_LOC_ADDR_COUNTRY as CONT15_0_0_, contactbea1_.CONT_MAIL_ADDR_LINE_1 as CONT16_0_0_, contactbea1_.CONT_MAIL_ADDR_LINE_2 as CONT17_0_0_, contactbea1_.CONT_MAIL_ADDR_CITY as CONT18_0_0_, contactbea1_.CONT_MAIL_ADDR_STATE as CONT19_0_0_, contactbea1_.CONT_MAIL_ADDR_ZIP_CD as CONT20_0_0_, contactbea1_.CONT_MAIL_ADDR_ZIP_CD_4 as CONT21_0_0_, contactbea1_.CONT_MAIL_ADDR_COUNTRY as CONT22_0_0_, contactbea1_.CONT_BUSINESS_TEL_NO as CONT23_0_0_, contactbea1_.CONT_BUSINESS_TEL_EXT as CONT24_0_0_, contactbea1_.CONT_MOBILE_TEL_NO as CONT25_0_0_, contactbea1_.CONT_TOLL_FREE_TEL_NO as CONT26_0_0_, contactbea1_.CONT_TOLL_FREE_TEL_EXT as CONT27_0_0_, contactbea1_.CONT_FAX_NO as CONT28_0_0_, contactbea1_.CONT_EMAIL_ADDR as CONT29_0_0_, contactbea1_.EFF_DT as EFF30_0_0_, contactbea1_.TERM_DT as TERM31_0_0_, contactbea1_.TERM_REASON as TERM32_0_0_, contactbea1_.CREATE_ON_DT as CREATE33_0_0_, contactbea1_.CREATE_BY_USER as CREATE34_0_0_, contactbea1_.LAST_MOD_ON_DT as LAST35_0_0_, contactbea1_.LAST_MOD_BY_USER as LAST36_0_0_ from FAC_CONT facilityco0_, CONT contactbea1_ where facilityco0_.CONT_ID=contactbea1_.CONT_ID(+) and facilityco0_.FAC_CONT_ID=?
[12/28/05 21:54:54:712 IST] 0000003e SystemOut O Hibernate: update CONT set CONT_FIRST_NAME=?, CONT_LAST_NAME=?, CONT_INTERNAL_EXTERNAL_FLG=?, STATUS_ID=?, PHCS_TERR_ID=?, PHCS_LOC=?, CONT_TITLE=?, CONT_LOC_ADDR_LINE_1=?, CONT_LOC_ADDR_LINE_2=?, CONT_LOC_ADDR_CITY=?, CONT_LOC_ADDR_STATE=?, CONT_LOC_ADDR_ZIP_CD=?, CONT_LOC_ADDR_ZIP_CD_4=?, CONT_LOC_ADDR_COUNTRY=?, CONT_MAIL_ADDR_LINE_1=?, CONT_MAIL_ADDR_LINE_2=?, CONT_MAIL_ADDR_CITY=?, CONT_MAIL_ADDR_STATE=?, CONT_MAIL_ADDR_ZIP_CD=?, CONT_MAIL_ADDR_ZIP_CD_4=?, CONT_MAIL_ADDR_COUNTRY=?, CONT_BUSINESS_TEL_NO=?, CONT_BUSINESS_TEL_EXT=?, CONT_MOBILE_TEL_NO=?, CONT_TOLL_FREE_TEL_NO=?, CONT_TOLL_FREE_TEL_EXT=?, CONT_FAX_NO=?, CONT_EMAIL_ADDR=?, EFF_DT=?, TERM_DT=?, TERM_REASON=?, LAST_MOD_ON_DT=?, LAST_MOD_BY_USER=? where CONT_ID=?
Debug level Hibernate log excerpt:
|