Posted By:
Litsa_Kir
Posted On:
Monday, August 18, 2003 02:21 PM
OK I don't mean to be a pest, but either I'm stupid, or I should have chosen an easier project In the case of cmp ejbs the code of the servlet is as follows: SessionManagerHome sessionMgrs; SessionManager sessionCounter; try { sessionCounter = sessionMgrs.findByPrimaryKey(sessionId); } catch (FinderException fE) { sessionCounter = sessionMgrs.create(sessionId); } In the case of plain JDBC try { sessionCount = db.read(requestedSessionId) + 1L; db.update(requestedSessionId, sessionCount); } catch (Exception e) { sessionCount = 1L; db.create(requestedSessio
More>>
OK I don't mean to be a pest, but either I'm stupid, or I should have chosen an easier project
In the case of cmp ejbs the code of the servlet is as follows:
SessionManagerHome sessionMgrs;
SessionManager sessionCounter;
try {
sessionCounter = sessionMgrs.findByPrimaryKey(sessionId);
} catch (FinderException fE) {
sessionCounter = sessionMgrs.create(sessionId);
}
In the case of plain JDBC
try {
sessionCount = db.read(requestedSessionId) + 1L;
db.update(requestedSessionId, sessionCount);
} catch (Exception e) {
sessionCount = 1L;
db.create(requestedSessionId, sessionCount);
}
In the first case, there should be 2 database accesses, one for the finder method of the home object and one for the entity bean returned by the query.
In the second case there is just one database access.
Is this right, or should I kill myself and get it over with?
<<Less