I have exception in my "delete" method but similar "add" method working correct.
Please help me with my problem))
Code:
26.03.2012 21:33:41 org.hibernate.event.internal.DefaultDeleteEventListener deleteTransientEntity
INFO: HHH000114: Handling transient entity in delete processing
Code:
public void delBlockedProcess(String ip, String nameBlockProcess) throws SQLException{
Session session = null;
try{
BlockedProcess exemBlock = new BlockedProcess();
exemBlock.setClientIP_id(ip);
exemBlock.setBlockedName(nameBlockProcess);
session = factory.openSession();
session.beginTransaction();
session.delete(exemBlock);
session.getTransaction().commit();
}catch(Exception ex){
System.out.println("Error in delBlockedNameByIP " + ex.getMessage());
}finally{
if(session != null && session.isOpen()){
session.close();
}
}
}
Code:
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="/WEB-INF/jdbc.properties" />
</bean>
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="${jdbc.driverClassName}" />
<property name="url" value="${jdbc.databaseurl}" />
<property name="username" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
</bean>
<bean id="mySessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="mappingResources">
<list>
<value>springapp/hibernate_logic/ClientIP.hbm.xml</value>
<value>springapp/hibernate_logic/StartProcess.hbm.xml</value>
<value>springapp/hibernate_logic/BlockedProcess.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${jdbc.dialect}</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
<property name="dataSource">
<ref bean="dataSource"/>
</property>
</bean>