The line you mention is not the culprit as I added that line after I figured out what line was causeing the issue.
I should prob. note that the first time this code runs it executes within a few seconds. The second time results in a few minutes...
Here is the output w/ the line removed:
2003-01-16 11:24:49,987 DEBUG [com.schedulestar.leaguecentral.servlet.UserContactInfoAdd] Running doPost()
2003-01-16 11:24:49,987 DEBUG [com.schedulestar.leaguecentral.servlet.UserContactInfoAdd] Retrieved all parameters
2003-01-16 11:24:49,987 DEBUG [com.schedulestar.leaguecentral.servlet.UserContactInfoAdd] Getting UserManagement
2003-01-16 11:24:49,987 DEBUG [com.schedulestar.leaguecentral.servlet.UserContactInfoAdd] Got UserManagement
2003-01-16 11:24:49,987 DEBUG [com.schedulestar.leaguecentral.servlet.UserContactInfoAdd] Adding contact info
2003-01-16 11:24:49,987 DEBUG [com.schedulestar.leaguecentral.ejb.session.UserManagementBean] Retrieving ContactInfo
2003-01-16 11:24:49,987 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCFindByPrimaryKeyQuery.ContactType.findByPrimaryKey] Executing SQL: SELECT contactTypeId FROM ContactType WHERE contactTypeId=?
2003-01-16 11:24:49,987 DEBUG [com.schedulestar.leaguecentral.ejb.session.UserManagementBean] ContactInfo retrieved
2003-01-16 11:24:49,987 DEBUG [com.schedulestar.leaguecentral.ejb.session.UserManagementBean] Creating UserContactInfo
2003-01-16 11:24:49,987 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.UserContactInfo] Create: pk=com.schedulestar.leaguecentral.ejb.entity.UserContactInfoPK@eda5
2003-01-16 11:24:49,987 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.UserContactInfo] Executing SQL: SELECT COUNT(*) FROM UserContactInfo WHERE userContactInfoId=?
2003-01-16 11:24:49,987 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.UserContactInfo] Executing SQL: INSERT INTO UserContactInfo (userContactInfoId, info, preferred, User_userContactInfo, contactType) VALUES (?, ?, ?, ?, ?)
2003-01-16 11:24:49,987 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.UserContactInfo] Rows affected = 1
2003-01-16 11:24:49,987 DEBUG [com.schedulestar.leaguecentral.ejb.session.UserManagementBean] UserContactInfo created
2003-01-16 11:24:49,987 DEBUG [com.schedulestar.leaguecentral.ejb.session.UserManagementBean] Setting Contact type
2003-01-16 11:24:49,987 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.ContactType] Executing SQL: SELECT contactTypeId,type FROM ContactType WHERE (contactTypeId=?) OR (contactTypeId=?) OR (contactTypeId=?) OR (contactTypeId=?) OR (contactTypeId=?) OR (contactTypeId=?) OR (contactTypeId=?) OR (contactTypeId=?) OR (contactTypeId=?) OR (contactTypeId=?) OR (contactTypeId=?)
2003-01-16 11:24:49,997 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadRelationCommand.ContactType] Executing SQL: SELECT contactType, userContactInfoId FROM UserContactInfo WHERE (contactType=?) OR (contactType=?) OR (contactType=?) OR (contactType=?) OR (contactType=?) OR (contactType=?) OR (contactType=?) OR (contactType=?) OR (contactType=?) OR (contactType=?) OR (contactType=?)
2003-01-16 11:25:33,319 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] Resized cache for bean Formula: old capacity = 1000000, new capacity = 50
2003-01-16 11:26:47,346 DEBUG [com.schedulestar.leaguecentral.ejb.session.UserManagementBean] Contact type set
2003-01-16 11:26:47,346 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.UserContactInfo] Executing SQL: UPDATE UserContactInfo SET preferred=?, contactType=? WHERE userContactInfoId=?
2003-01-16 11:26:47,346 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.UserContactInfo] Rows affected = 1
2003-01-16 11:26:47,346 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCFindByPrimaryKeyQuery.User.findByPrimaryKey] Executing SQL: SELECT userId FROM User WHERE userId=?
2003-01-16 11:26:47,356 DEBUG [com.schedulestar.leaguecentral.ejb.session.UserManagementBean] Adding contact info to user
2003-01-16 11:26:47,356 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.User] Executing SQL: SELECT emailAddress, password, lastLoginDate, firstName, lastName, address1, address2, city, postalCode, title, notes, active, middleName, suffix, certifications, userType, athleticDirector, Boards_user, official, officialsAssigner, state, scheduleManager, parent, leagueContact FROM User WHERE (userId=?)
2003-01-16 11:26:47,356 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadRelationCommand.User] Executing SQL: SELECT userContactInfoId FROM UserContactInfo WHERE (User_userContactInfo=?)
2003-01-16 11:26:47,396 DEBUG [com.schedulestar.leaguecentral.ejb.session.UserManagementBean] Contact info added
2003-01-16 11:26:47,396 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.UserContactInfo] Executing SQL: UPDATE UserContactInfo SET User_userContactInfo=? WHERE userContactInfoId=?
2003-01-16 11:26:47,396 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.UserContactInfo] Rows affected = 1
2003-01-16 11:26:47,396 DEBUG [com.schedulestar.leaguecentral.servlet.UserContactInfoAdd] Contact info added
Here is the whole chunk of code:
public UserContactInfo addContactInfo(UserPK _userPK, ContactTypePK _contactTypePK,
String _info, Boolean _preferred)
throws CreateException
{
try {
logger.debug("Retrieving ContactInfo");
Context ctx = new InitialContext();
ContactTypeHome contactTypeHome = (ContactTypeHome)ctx.lookup(EJBConstants.JNDI.CONTACT_TYPE);
ContactType contactType = contactTypeHome.findByPrimaryKey(_contactTypePK);
logger.debug("ContactInfo retrieved");
logger.debug("Creating UserContactInfo");
UserContactInfoHome userContactInfoHome = (UserContactInfoHome)ctx.lookup(EJBConstants.JNDI.USER_CONTACT_INFO);
Integer pk = (Integer)pkp.getNextPrimaryKeyValue(UserContactInfo.class);
UserContactInfo userContactInfo = userContactInfoHome.create(pk, _info);
logger.debug("UserContactInfo created");
if (_preferred != null) userContactInfo.setPreferred(_preferred);
logger.debug("Setting Contact type");
//logger.debug("Setting contact type "+contactType.getType()+ " id "+contactType.getContactTypeId());
// This line takes 2 minutes to work sometimes....
userContactInfo.setContactType(contactType);
logger.debug("Contact type set");
UserHome userHome = (UserHome)ctx.lookup(EJBConstants.JNDI.USER);
User user = userHome.findByPrimaryKey(_userPK);
logger.debug("Adding contact info to user");
Collection uci = user.getUserContactInfo();
uci.add(userContactInfo);
logger.debug("Contact info added");
return userContactInfo;
}
catch (Exception e) {
throw new CreateException(e.getMessage());
}
}
Any help would be great!