REPEATABLE_READ fails with 1 User
Now I am even more confused. I just changed jbc isolation from read_committed to
repeatable_read and now this test fails with *1* user on the very first iteration:
Failure:
anonymous wrote : runner for user=ltester-100000 did not complete all iterations;
cause=[ThreadId=1] userSession null after successful login; user=ltester-100000
java.lang.IllegalStateException: userSession null after successful login;
user=ltester-100000 at
com.doppelganger.service.userservice.MultiuserLoginTest.login(MultiuserLoginTest.java:120)
Test code:
| public void login(final String ltesterUserName) throws Exception {
| LOG.debug("begin actual login user=" + ltesterUserName);
|
| //add userSession
| final UserSession us1 = (UserSession) txTemplate.executeWithException(new
TransactionCallbackWithException() {
|
| public Object doInTransactionWithException(TransactionStatus status)
throws Exception {
|
| //add user session, throw exception if one does not exist
| LOG.debug("before findByName user=" + ltesterUserName);
| final User usr = getUserDao().findByNameChecked(ltesterUserName);
|
| UserSession userSession = new UserSession(usr);
| userSession.setToken(UUID.randomUUID().toString());
|
| userSession.setLoginTime(new Timestamp(System.currentTimeMillis()));
| userSession.resetSessionTimeout(); //ok here
|
| //attach userSession to User
| LOG.debug("before initCurrentUserSession user=" +
ltesterUserName);
| usr.initCurrentUserSession(userSession);
| LOG.debug("after initCurrentUserSession user=" +
ltesterUserName);
|
| return userSession;
|
| }
| });
|
| LOG.debug("end actual login user=" + ltesterUserName);
|
| //check that we can get at userSession
| final UserSession us2 = getCurrentUserSession(ltesterUserName);
|
| if (us2 == null) {
| throw new IllegalStateException("userSession null after successful
login; user=" + ltesterUserName);
| }
|
| if (!us1.equals(us2)) {
| throw new IllegalStateException("us1 != us2");
| }
| }
Any ideas?
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4215839#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...