Re: [jboss-user] [jBPM] - Multiple JBPM4_VARIABLE records pointing to same LOB_ and different EXECUTIONID_
by Jorge Ferreira
Jorge Ferreira [http://community.jboss.org/people/imjorge] replied to the discussion
"Multiple JBPM4_VARIABLE records pointing to same LOB_ and different EXECUTIONID_"
To view the discussion, visit: http://community.jboss.org/message/549542#549542
--------------------------------------------------------------
We have found the cause of the problem.
Basically jBPM was reusing the same block of identifiers as can be seen by the following two log lines:
73099 2010-06-24 16:40:54,018 DEBUG [org.jbpm.pvm.internal.id.DatabaseDbidGenerator] acquired new id block [2610001-2620000]
75993 2010-06-24 17:22:05,254 DEBUG [org.jbpm.pvm.internal.id.DatabaseDbidGenerator] acquired new id block [2610001-2620000]
That caused all sort of strange behavior. Now why is this happing? First let me talk about our environment setup.
We use jBPM as part of an EAR application deployed in jBOSS. Because we did not want to manage different databases we deployed the jBPM tables in our application database. So a single database with both application tables and jBPM tables.
The problem happens with very specific conditions, as one could expected, and is due to the nature of http://en.wikipedia.org/wiki/Nested_transaction nested transactions.
DatabaseDbIdGenerator picks a new block of ids inside a transaction. But because this can happen from an EJB call it will be a nested transaction.
> Nested transactions are implemented differently in databases. However, they have in common that the changes are not made visibile to any unrelated transactions until the outermost transaction has committed. This means that a commit in an inner transaction does not necessary persist updates to the database.
The problem only happens if the block generation happens in a nested transaction and the outer transaction - that would commit definitely the results of the nested transaction - rollbacks for some reason.
1. start transaction1. start jbpm transaction for block generation1. get current nextid from jbpm4_property - nextid = 1
2. update nextid in jbpm4_property - nextid = 100001
2. commit jbpm transaction
3. [...]
4. some error that causes an exception that means rollback
2. rollback transaction - nextid = 1
Because the ultimate result will be to rollback the transaction the block that jBPM THINKS that is on the database is now incorrect. But it still holds that block in memory and uses it to assign ids. The next time a block generation happens the ids will start to be repeated. Perhaps a check SHOULD be added in DatabaseDbIdGenerator to ensure that the nextId returned from the database is after the lastId consumed?
*Our solution:* implement a custom id generator that uses an independent transaction and hook it up using jbpm.default.cfg.xml.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/549542#549542]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 10 months
Re: [jboss-user] [JBoss Web Services] - Error deploying a Web Service
by Sidney Zurch
Sidney Zurch [http://community.jboss.org/people/zurchman] replied to the discussion
"Error deploying a Web Service"
To view the discussion, visit: http://community.jboss.org/message/549538#549538
--------------------------------------------------------------
Like they say in Las Vegas, "Bingo!"
Illega lAnnotation
You may have to post the code. And I'm curious about how SQL is related.
> Stefano Ficcadenti wrote:
>
> Logically I don't understand the problem, I use always Java Annotations (@WebService, @SOAPBinding,ecc...) and basic web.xml.
>
>
> Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
> java.lang.StackTraceElement does not have a no-arg default constructor.
> this problem is related to the following location:
> at java.lang.StackTraceElement
> at public java.lang.StackTraceElement[] java.lang.Throwable.getStackTrace()
> at java.lang.Throwable
> at java.lang.Exception
> at java.sql.SQLException
> at private java.sql.SQLException test.ws.jaxws.SQLExceptionBean.nextException
> at test.ws.jaxws.SQLExceptionBean
>
> ...
>
> DEPLOYMENTS IN ERROR:
> Deployment "vfsfile:/Applications/JBoss5.1/server/default/deploy/UnikaWS.war/" is in error due to the following reason(s): com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
> java.lang.StackTraceElement does not have a no-arg default constructor.
> this problem is related to the following location:
> at java.lang.StackTraceElement
> at public java.lang.StackTraceElement[] java.lang.Throwable.getStackTrace()
> at java.lang.Throwable
> at java.lang.Exception
> at java.sql.SQLException
> at private java.sql.SQLException test.ws.jaxws.SQLExceptionBean.nextException
> at test.ws.jaxws.SQLExceptionBean
>
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/549538#549538]
Start a new discussion in JBoss Web Services at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 10 months
AsyncUtils.mixinAsync future lock for a minute
by Javier Sanz
Hello,
I am testing async invocation using the examples in jboss 6.0
I got a strange execution ... when the client finish, it hold for a seconds
(around 50-60 seconds) before real end ...
If i put a System.exit , the execution is ok ... i found that the
AsyncUtils.mixinAsync and Future are in the trouble ...
When i list all threads remaining , i show a "1
Thread[pool-1-thread-1,5,main]" nivel 1 ...
If i debug the source, i get that the thread is in following mode:
"pool-1-thread-1" prio=6 tid=0x04260000 nid=0xf80 waiting on condition
[0x0667f000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x1590c730> (a
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
at
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1925)
at
java.util.concurrent.PriorityBlockingQueue.take(PriorityBlockingQueue.java:220)
at
org.jboss.resource.adapter.mail.inflow.NewMsgsWorker.run(NewMsgsWorker.java:78)
at org.jboss.resource.work.WorkWrapper.run(WorkWrapper.java:172)
at
org.jboss.threads.SimpleDirectExecutor.execute(SimpleDirectExecutor.java:33)
at org.jboss.threads.QueueExecutor.runTask(QueueExecutor.java:780)
at org.jboss.threads.QueueExecutor.access$100(QueueExecutor.java:45)
at org.jboss.threads.QueueExecutor$Worker.run(QueueExecutor.java:800)
at java.lang.Thread.run(Thread.java:619)
at org.jboss.threads.JBossThread.run(JBossThread.java:122)
and the main thread is blocked to end until this thread stop .... wasted 50
seconds ...
how can i do to fix it
thank you
/* ------------------------------ cut & paste
------------------------------------------------------------ */
package paq;
import java.util.Date;
import java.util.Hashtable;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import javax.naming.Context;
import javax.naming.InitialContext;
import org.jboss.ejb3.common.proxy.plugins.async.AsyncUtils;
public class Client {
public static void main(String[] args) throws Exception {
Hashtable<String, String> environment = new Hashtable<String,
String>();
environment.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
environment.put(Context.URL_PKG_PREFIXES,
"org.jboss.naming:org.jnp.interfaces");
environment.put(Context.PROVIDER_URL, "jnp://localhost:1099");
InitialContext ctx = new InitialContext(environment);
Echo echo = (Echo) ctx.lookup("TestEAR/EchoBean/remote");
System.out.println("-------- Synchronous call");
String ret = echo.echo("1.- normal call");
System.out.println(ret);
Echo asynchEcho = AsyncUtils.mixinAsync(echo);
System.out.println("-------- Asynchronous call");
ret = asynchEcho.echo("2.- asynchronous call test");
// deberia devolver null en ret
System.out.println("Direct return of async invocation is: " + ret);
System.out.println("-------- Synchronous call");
ret = echo.echo("3.- normal call 2");
System.out.println(ret);
System.out.println("-------- Result of Asynchronous call");
Future<?> future = AsyncUtils.getFutureResult(asynchEcho);
System.out.println("Waiting for asynbch invocation to complete");
ret = (String) future.get(500, TimeUnit.MILLISECONDS);
System.out.println(future.isDone());
System.out.println("->" + ret + " " + new Date());
// ThreadUtilities.getThread("pool-1-thread-1").interrupt();
System.out.println("FIN");
// new Thread().start();
//listThreads();
/*
System.out.println("----------------");
listThreads();
System.out.println(""+ new Date());
Thread.currentThread().sleep(60*1000);
System.out.println("----------------");
System.out.println(""+ new Date());
*/
listThreads();
System.exit(0);
}
public static void listThreads() {
// Find the root thread group
ThreadGroup root =
Thread.currentThread().getThreadGroup().getParent();
while (root.getParent() != null) {
root = root.getParent();
}
// Visit each thread group
visit(root, 0);
}
// This method recursively visits all thread groups under `group'.
public static void visit(ThreadGroup group, int level) {
// Get threads in `group'
int numThreads = group.activeCount();
Thread[] threads = new Thread[numThreads * 2];
numThreads = group.enumerate(threads, false);
// Enumerate each thread in `group'
for (int i = 0; i < numThreads; i++) {
// Get thread
Thread thread = threads[i];
System.out.println(level + " " + thread);
}
// Get thread subgroups of `group'
int numGroups = group.activeGroupCount();
ThreadGroup[] groups = new ThreadGroup[numGroups * 2];
numGroups = group.enumerate(groups, false);
// Recursively visit each subgroup
for (int i = 0; i < numGroups; i++) {
visit(groups[i], level + 1);
}
}
}
/* ------------------------------ cut & paste
------------------------------------------------------------ */
/* ******************* CONSOLE OUTPUT *************************** */
-------- Synchronous call
1.- normal call
-------- Asynchronous call
Direct return of async invocation is: null
-------- Synchronous call
3.- normal call 2
-------- Result of Asynchronous call
Waiting for asynbch invocation to complete
true
->2.- asynchronous call test Thu Jun 24 16:55:30 GMT+01:00 2010
FIN
0 Thread[Reference Handler,10,system]
0 Thread[Finalizer,8,system]
0 Thread[Signal Dispatcher,9,system]
0 Thread[Attach Listener,5,system]
0 Thread[RMI RenewClean-[127.0.0.1:1098],5,system]
0 Thread[GC Daemon,2,system]
0 Thread[RMI Scheduler(0),5,system]
1 Thread[main,5,main]
1 Thread[pool-1-thread-1,5,main]
15 years, 10 months