Here is the code. In my log I see no INSERT's or DELETEs performed.
Code:
Session theSession = BoardroomFinder.getSessionFactory().openSession();
Transaction tx = theSession.beginTransaction();
if (getPendingStatus().intValue() == Boardroom.NEW)
{
setPendingStatus(new Integer(0));
setLastUpdate(new Date());
theSession.saveOrUpdate(this);
}
else if (getPendingStatus().intValue() == Boardroom.MODIFY)
{
Query deleteOldBoardroom = theSession.createQuery("DELETE FROM Boardroom WHERE boardroomId = :bid AND pendingStatus = 0");
deleteOldBoardroom.setInteger("bid", getBoardroomId().intValue());
deleteOldBoardroom.executeUpdate();
}
else if (getPendingStatus().intValue() == Boardroom.DELETED)
{
Query deleteBoardrooms = theSession.createQuery("DELETE FROM Boardroom WHERE boardroomId = :bid");
deleteBoardrooms.executeUpdate();
}
tx.commit();
theSession.close();
Log fileCode:
[8/26/05 9:16:36:734 EDT] 3e108d4b SessionFactor I org.hibernate.impl.SessionFactoryImpl building session factory
[8/26/05 9:16:36:750 EDT] 3e108d4b Configurator W net.sf.ehcache.config.Configurator No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: wsjar:file:/C:/Program Files/WebSphere/AppServer/installedApps/lithium/BoardroomFinder.ear/boardroom.war/WEB-INF/lib/ehcache-1.1.jar!/ehcache-failsafe.xml
[8/26/05 9:16:37:906 EDT] 3e108d4b SessionFactor I org.hibernate.impl.SessionFactoryObjectFactory Not binding factory to JNDI, no JNDI name configured
[8/26/05 9:16:37:906 EDT] 3e108d4b SessionFactor I org.hibernate.impl.SessionFactoryImpl Checking 0 named queries
[8/26/05 9:16:38:297 EDT] 3e108d4b SystemOut O Hibernate: select capability0_.ID as ID, capability0_.ENGLISHTEXT as ENGLISHT2_1_, capability0_.FRENCHTEXT as FRENCHTEXT1_, capability0_.OFFSET as OFFSET1_, capability0_.ENGLISHDESCRIPTION as ENGLISHD5_1_, capability0_.FRENCHDESCRIPTION as FRENCHDE6_1_ from SBF_CAPABILITY capability0_ order by OFFSET
[8/26/05 9:16:43:015 EDT] 3e108d4b WebGroup I SRVE0180I: [<null>] [/finder] [Servlet.LOG]: /updates.jsp: init
[8/26/05 9:16:43:031 EDT] 3e108d4b SystemOut O Hibernate: select boardroom0_.ID as ID, boardroom0_.BOARDROOMID as BOARDROO2_0_, boardroom0_.DEPARTMENTID as DEPARTME3_0_, boardroom0_.PENDINGSTATUS as PENDINGS4_0_, boardroom0_.ENGLISHTITLE as ENGLISHT5_0_, boardroom0_.FRENCHTITLE as FRENCHTI6_0_, boardroom0_.ENGLISHADDRESS as ENGLISHA7_0_, boardroom0_.FRENCHADDRESS as FRENCHAD8_0_, boardroom0_.PROVINCE as PROVINCE0_, boardroom0_.CITY as CITY0_, boardroom0_.MINCAPACITY as MINCAPA11_0_, boardroom0_.MAXCAPACITY as MAXCAPA12_0_, boardroom0_.ENGLISHNOTES as ENGLISH13_0_, boardroom0_.FRENCHNOTES as FRENCHN14_0_, boardroom0_.CAPABILITY as CAPABILITY0_, boardroom0_.LASTUPDATE as LASTUPDATE0_, boardroom0_.UPDATEDBY as UPDATEDBY0_, boardroom0_.UPDATEDNOTES as UPDATED18_0_, boardroom0_.TELEPHONE1 as TELEPHONE19_0_, boardroom0_.TELEPHONE2 as TELEPHONE20_0_, boardroom0_.FAX as FAX0_, boardroom0_.EMAIL as EMAIL0_ from SBF_BOARDROOM boardroom0_ where boardroom0_.PENDINGSTATUS>0
[8/26/05 9:16:45:218 EDT] 3e108d4b WebGroup I SRVE0180I: [<null>] [/finder] [Servlet.LOG]: /updatesHandler.jsp: init
[8/26/05 9:16:45:234 EDT] 3e108d4b SystemOut O Hibernate: select boardroom0_.ID as ID, boardroom0_.BOARDROOMID as BOARDROO2_0_, boardroom0_.DEPARTMENTID as DEPARTME3_0_, boardroom0_.PENDINGSTATUS as PENDINGS4_0_, boardroom0_.ENGLISHTITLE as ENGLISHT5_0_, boardroom0_.FRENCHTITLE as FRENCHTI6_0_, boardroom0_.ENGLISHADDRESS as ENGLISHA7_0_, boardroom0_.FRENCHADDRESS as FRENCHAD8_0_, boardroom0_.PROVINCE as PROVINCE0_, boardroom0_.CITY as CITY0_, boardroom0_.MINCAPACITY as MINCAPA11_0_, boardroom0_.MAXCAPACITY as MAXCAPA12_0_, boardroom0_.ENGLISHNOTES as ENGLISH13_0_, boardroom0_.FRENCHNOTES as FRENCHN14_0_, boardroom0_.CAPABILITY as CAPABILITY0_, boardroom0_.LASTUPDATE as LASTUPDATE0_, boardroom0_.UPDATEDBY as UPDATEDBY0_, boardroom0_.UPDATEDNOTES as UPDATED18_0_, boardroom0_.TELEPHONE1 as TELEPHONE19_0_, boardroom0_.TELEPHONE2 as TELEPHONE20_0_, boardroom0_.FAX as FAX0_, boardroom0_.EMAIL as EMAIL0_ from SBF_BOARDROOM boardroom0_ where ID=8
[8/26/05 9:16:45:249 EDT] 7a47cd4e WebGroup I SRVE0180I: [<null>] [/finder] [Servlet.LOG]: /editBoardroom.jsp: init
[8/26/05 9:16:45:249 EDT] 7a47cd4e SystemOut O Hibernate: select boardroom0_.ID as ID, boardroom0_.BOARDROOMID as BOARDROO2_0_, boardroom0_.DEPARTMENTID as DEPARTME3_0_, boardroom0_.PENDINGSTATUS as PENDINGS4_0_, boardroom0_.ENGLISHTITLE as ENGLISHT5_0_, boardroom0_.FRENCHTITLE as FRENCHTI6_0_, boardroom0_.ENGLISHADDRESS as ENGLISHA7_0_, boardroom0_.FRENCHADDRESS as FRENCHAD8_0_, boardroom0_.PROVINCE as PROVINCE0_, boardroom0_.CITY as CITY0_, boardroom0_.MINCAPACITY as MINCAPA11_0_, boardroom0_.MAXCAPACITY as MAXCAPA12_0_, boardroom0_.ENGLISHNOTES as ENGLISH13_0_, boardroom0_.FRENCHNOTES as FRENCHN14_0_, boardroom0_.CAPABILITY as CAPABILITY0_, boardroom0_.LASTUPDATE as LASTUPDATE0_, boardroom0_.UPDATEDBY as UPDATEDBY0_, boardroom0_.UPDATEDNOTES as UPDATED18_0_, boardroom0_.TELEPHONE1 as TELEPHONE19_0_, boardroom0_.TELEPHONE2 as TELEPHONE20_0_, boardroom0_.FAX as FAX0_, boardroom0_.EMAIL as EMAIL0_ from SBF_BOARDROOM boardroom0_ where ID=8
[8/26/05 9:16:45:312 EDT] 7a47cd4e SharedPool I J2CA0086W: Shareable connection MCWrapper id 5f804d5f Managed connection com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl@3f70cd5f State:STATE_TRAN_WRAPPER_INUSE
from resource jdbc/padDS was used within a local transaction containment boundary.
[8/26/05 9:16:45:312 EDT] 7a47cd4e SystemOut O Hibernate: SELECT capability.ID as ID0_, capability.ENGLISHTEXT as ENGLISHT2_1_0_, capability.FRENCHTEXT as FRENCHTEXT1_0_, capability.OFFSET as OFFSET1_0_, capability.ENGLISHDESCRIPTION as ENGLISHD5_1_0_, capability.FRENCHDESCRIPTION as FRENCHDE6_1_0_ FROM sbf_capability capability ORDER BY strip_html(capability.englishText)
[8/26/05 9:16:50:218 EDT] 7a47cd4e WebGroup I SRVE0180I: [<null>] [/finder] [Servlet.LOG]: /boardroomHandler.jsp: init
[8/26/05 9:16:50:249 EDT] 7a47cd4e SystemOut O Hibernate: delete from SBF_BOARDROOM where BOARDROOMID=? and PENDINGSTATUS=0
[8/26/05 9:18:20:461 EDT] 790d0d4d WebGroup I SRVE0180I: [<null>] [/finder] [Servlet.LOG]: SimpleFileServlet: destroy
[8/26/05 9:18:20:461 EDT] 790d0d4d WebGroup I SRVE0180I: [<null>] [/finder] [Servlet.LOG]: JSP 1.2 Processor: destroy
[8/26/05 9:18:20:571 EDT] 790d0d4d WebGroup I SRVE0180I: [<null>] [/finder] [Servlet.LOG]: JSP 1.2 Processor: init
[8/26/05 9:18:20:758 EDT] 790d0d4d WebGroup I SRVE0180I: [<null>] [/finder] [Servlet.LOG]: SimpleFileServlet: init
[8/26/05 9:20:37:046 EDT] 3e108d4b WebGroup I SRVE0180I: [<null>] [/finder] [Servlet.LOG]: /capability.jsp: init