[EJB/JBoss] - Performance vs. Security
by TheEJBPope
Hi folks,
I've been doing some EJB profiling lately and one of the cpu hot spots was related to the doPrivileged() method.
I've got a classic facade design : a stateful session bean, accessible remotely by clients, which uses a number of BMP EJB's to fetch data. The entity beans are only accessible locally.
The facade does for each entity bean two method calls; to get two properties. For each call doPrivileged pops up. The trouble is that there are a lot of entity beans to address for one client request. And in the end the method calls add up to a real performance issue.
Is there a way to prevent, switch off, whatever, security checks for entity beans ? (Or is this doPrivileged call related to something else entirely ?)
In my case it won't make much sense to check the entity beans anyway. If the user obtained an instance of the session bean, it implicitely means the data must be accessible too.
Many thanks for any clue !
Jan
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3976268#3976268
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3976268
19 years, 7 months
[JBoss jBPM] - Transient variables disappear when signal into end-state
by aleekl
here's the background to my problem:
I have the following process definition
START----->TASK-NODE----->NODE(with custom action)------>END
here's the code to the custom action class:
| public void execute(ExecutionContext executionContext) throws Exception {
| //check if TEST mode is one
| ContextInstance contextInstance = executionContext.getContextInstance();
| String testMode = (String)contextInstance.getTransientVariable(JbpmConstants.TEST_KEY);
|
| //TEST MODE OFF
| if(null == testMode) {
| executionContext.leaveNode(JbpmConstants.TRANSITION_GO_NEXT);
| }
| //TEST MODE ON
| else {
|
| //set node name in as both key and value
| contextInstance.setTransientVariable(JbpmConstants.NODE_UPDATE, JbpmConstants.NODE_UPDATE);
| String exceptionFlag = (String)contextInstance.getTransientVariable(JbpmConstants.TEST_UPDATE_EXCEPTION);
| if(null == exceptionFlag) {
| //no exception
| executionContext.leaveNode(JbpmConstants.TRANSITION_GO_NEXT);
| }
| else {
| throw new Exception(JbpmConstants.TEST_UPDATE_EXCEPTION); //test for exception
| }
| }
| }
| }
|
and here is the code for my junit test:
| .
| .
| .
| _token.signal();
| _activatedNode = (String)_token.getProcessInstance().getContextInstance().getTransientVariable(JbpmConstants.NODE_UPDATE);
| assertNotNull(_activatedNode);
| assertEquals(_activatedNode, JbpmConstants.NODE_UPDATE);
|
The idea is I want to test to make sure my custom-node is activated after signalling from the TASK-NODE, and I'm using transient variables to test this result. So far this has work with other workflows where a signal of a task node leads to another task node (i.e. not end state). However once I signal from a task-node into an eventual end-state, I find that all my transient variables are gone.
I've also tried to print out all variables (transient and non-transient) after the signal() call, but both maps are null.
Does anyone know why this is so?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3976263#3976263
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3976263
19 years, 7 months