public synchronized void updateState(ServiceStateProcessor<T> processor) {
//		String transactionId = null;
//		try {
//			javax.transaction.TransactionManager transactionManager = com.arjuna.ats.jta.TransactionManager.transactionManager();
//			TransactionImple transaction = (TransactionImple) transactionManager.getTransaction();
//			if (transaction == null)
//				return;
//			
//			int status = transaction.getStatus();
//			transactionId = transaction.get_uid().stringForm();
//			//transactionId = TransactionManager.getTransactionId();
//		} catch (Exception e) {
//			e.printStackTrace();
//			return;
//		}
		BasicAction currentAction = ThreadActionData.currentAction();
		if (currentAction == null)
			return;
		String transactionId = ThreadActionData.currentAction().get_uid().toString();
		if (transactionId == null)
			//TODO follow specified TX policy
			return;
		// we cannot proceed while a (another) prepare is in progress
		while (isLocked()) {
			try {
				wait();
			} catch (InterruptedException e) {
				// ignore
			}
		}
		T derivedState = getDerivedState(transactionId);
		if (derivedState != null) {
			if (!processor.validateState(derivedState)) {
				//TODO get error message from processor
				throw new WebServiceException("Invalid request");
			}
			// update the number of booked and free seats in the derived state
			processor.updateState(derivedState);
		} else {
			if (!processor.validateState(currentState)) {
				//TODO get error message from processor
				throw new WebServiceException("Invalid request");
			}
			// create a state derived from the current state which holds the new value(s)
			T childState = currentState.getDerivedState();
			// updates current state using values from the specified derived state
			processor.updateState(childState);
			// install the specified derived state as the current transaction state
			putDerivedState(transactionId, childState);
			//currentState = childState;
		}
	}
public synchronized void updateState(ServiceStateProcessor<T> processor) {
		BasicAction currentAction = ThreadActionData.currentAction();
		if (currentAction == null)
			return;
		String transactionId = ThreadActionData.currentAction().get_uid().toString();
		if (transactionId == null)
		
			return;
	
		while (isLocked()) {
			try {
				wait();
			} catch (InterruptedException e) {
			
			}
		}
		T derivedState = getDerivedState(transactionId);
		if (derivedState != null) {
			if (!processor.validateState(derivedState)) {
			
				throw new WebServiceException("Invalid request");
			}
		
			processor.updateState(derivedState);
		} else {
			if (!processor.validateState(currentState)) {
			
				throw new WebServiceException("Invalid request");
			}
		
			T childState = currentState.getDerivedState();
		
			processor.updateState(childState);
		
			putDerivedState(transactionId, childState);
		
		}
	}
public synchronized void updatestate(servicestateprocessor<t> processor) { basicaction currentaction = threadactiondata.currentaction(); if (currentaction == null) return; string transactionid = threadactiondata.currentaction().get_uid().tostring(); if (transactionid == null) return; while (islocked()) { try { wait(); } catch (interruptedexception e) { } } t derivedstate = getderivedstate(transactionid); if (derivedstate != null) { if (!processor.validatestate(derivedstate)) { throw new webserviceexception("invalid request"); } processor.updatestate(derivedstate); } else { if (!processor.validatestate(currentstate)) { throw new webserviceexception("invalid request"); } t childstate = currentstate.getderivedstate(); processor.updatestate(childstate); putderivedstate(transactionid, childstate); } }