[jboss-user] [JBoss Seam] - Re: resetting/clearing a session scoped SFSB

asookazian do-not-reply at jboss.com
Wed Dec 26 16:49:10 EST 2007


I tried the following code:

Session.instance().invalidate();

1) I have 2 session-scoped SFSB's.  How does Seam handle this?  Are both of them invalidated?

2) How/when does Seam re-instantiate the SFSB's that were invalidated?

I am getting the following exception when peerAction SFSB is referenced below:

  | Caused by: java.lang.NullPointerException
  | 	at com.cox.beans.session.SecurityAuditAction.findAuditList(SecurityAuditAction.java:151)
  | 	at com.cox.beans.session.SecurityAuditAction.invalidateSession(SecurityAuditAction.java:134)

with:

  | public void invalidateSession() {
  | 		
  | 		//user selected a peer from peer selectOneMenu, so invalidate session and continue...
  | 				
  | 		Session.instance().invalidate();
  | 		
  | 		findAuditList();
  | 	}
  | 				
  | 	// 12-03/07 - got following exception when I clicked cancel in modalPanel:
  | 	// Caused by java.lang.IllegalStateException with message: "begin method invoked from a long-running conversation, try using @Begin(join=true) on method: findAuditList" 
  | 	// adding join=true...
  | 		
  | 	@Begin(join=true, flushMode=FlushModeType.MANUAL)   // <-- use this with SMPC	
  |     @Factory("myAuditList")
  |     public void findAuditList()
  |     {			
  | 		Boolean hardCodeEmployeeId = Boolean.parseBoolean(SecurityAuditProperties.getPropertyObject().getProperty(SecurityAuditConstants.HARD_CODE_EMPLOYEE_ID));
  | 		Integer employeeId;
  | 		
  | 		if (hardCodeEmployeeId) {  //if true in props file then we're testing only...
  | 			
  | 			employeeId = peerAction.getEmployeeId().intValue();
  | 			
  | 			if (employeeId == null) {	
  | 				
  | 				employeeId = Integer.parseInt(SecurityAuditProperties.getPropertyObject().getProperty(SecurityAuditConstants.EMPLOYEE_ID)); //using btkach id for now;
  | 			}
  | 		}
  | 		else {
  | 			log.info("in getAuditList(): user.getUserId() = " + user.getUserId() + " user.getBillingId() = " + user.getBillingId());   	
  |     	    
  | 			//employeeId = getEmployeeId();
  | 			
  | 			employeeId = peerAction.getEmployeeId().intValue();
  | 	    	
  | 		}	
  | 			myAuditList = emICOMS.createQuery("SELECT gem, tsaw "+
  | 										"FROM TblSecurityAuditWorking tsaw, "+					
  | 										"GlobalEmployeeMaster gem "+				
  | 										"WHERE tsaw.id.siteId 		= gem.id.siteId "+
  | 										"AND tsaw.id.employeeNumber = gem.id.employeeNumber "+				
  | 										"AND tsaw.reportToId 		= :employeeId " +
  | 										"ORDER BY tsaw.id.employeeNumber ASC")
  | 										.setParameter("employeeId", employeeId)
  | 										.getResultList();    	
  | 		    
  | 			//instantiate null valued noteList
  | 	    	noteAction.initialize(myAuditList);
  | 	    	    	
  | 	    	log.info("in findAuditList(): myAuditList.size() = " + myAuditList.size());
  | 	    	
  | 	    	noteLoadList = emICOMS.createQuery("SELECT saw.id.siteId, saw.id.employeeNumber, "+
  | 								    	"("+
  | 								    	"SELECT count(san) as AcctApprovedNoteCount "+
  | 								    	"FROM TblSecurityAuditNote san "+
  | 								    	"WHERE san.siteId = saw.id.siteId "+
  | 								    	"AND san.employeeNumber = saw.id.employeeNumber "+
  | 								    	"AND san.noteType = 'accountApproved' "+
  | 								    	") as AcctApprovedCount, "+
  | 								    	"("+
  | 								    	"SELECT count(san) as secLevelApprovedNoteCount "+
  | 								    	"FROM TblSecurityAuditNote san "+
  | 								    	"WHERE san.siteId = saw.id.siteId "+
  | 								    	"AND san.employeeNumber = saw.id.employeeNumber "+
  | 								    	"AND san.noteType = 'secLevelApproved' "+
  | 								    	") as secLevelApprovedCount, "+
  | 								    	"("+
  | 								    	"SELECT count(san) as adjLimitApprovedNoteCount "+
  | 								    	"FROM TblSecurityAuditNote san "+
  | 								    	"WHERE san.siteId = saw.id.siteId "+
  | 								    	"AND san.employeeNumber = saw.id.employeeNumber "+
  | 								    	"AND san.noteType = 'adjLimitApproved' "+
  | 								    	") as adjLimitApprovedCount "+
  | 								    	"FROM TblSecurityAuditWorking saw "+
  | 								    	"WHERE saw.reportToId = :employeeId")
  | 								    	.setParameter("employeeId", employeeId)
  | 								    	.getResultList();
  | 	    	
  | 	    	
  | 	    	
  | 	    	log.info("in findAuditList(): noteLoadList.size() = " + noteLoadList.size());
  | 	    	
  |     	
  |     	
  |     }

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115587#4115587

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4115587



More information about the jboss-user mailing list