I am also not convinced there is a bug here. If the datasource is not defined as an xa-datasource then AS7 will wrap it as a LastResource, Alexey definitely has to make that change.

As to the question of where the second resource is coming from, perhaps the EJB container registers a last resource also when transactions flow between EJBs, to do its bookkeeping but I am not altogether positive, anyway, without making that MySQL datasource an xa-datasource you wont get very far.

However, the bug with MySQL is real, so I would definitely reconsider the use of MySQL...

the short answer would be to use @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) on any EJB method that gets called from other beans that uses another datasources (i.e. a local call from another bean from another ear).

Going to Postgres is a hard option, since you need to redo all your Hibernate queries.

The only thing that we could do is to use MySQL Hibernate only from one Session EJB and from others we use direct connections (not via JBoss connection pool (!!!)).This is a most ugly thing that I ever saw in J2EE systems.

I cant understand why you cant do some workaround inside JBoss, why you are blaming MySQL for not supporting XA recovery..So what? I can open 200 connections to MySQL simultaneosly from different apps.So why there is no way to open db connections when two timer EJBs are connecting by local connection a simple Session EJB???

@Transaction attribute didnt help at all.

To us , this is a showstopper bug and we are a serious company, using JBoss as a core app server for our product.

The amount of time that my R&D tried to make a workaround is reallyy.... I am really disapointed....

Anybody here could give me a real workaround way for the trouble, except "Go talk to Mysql" or "Transaction attribute should work"?

And if you do decide to post a reproducible test case can you first apply the advice we have already provided in this thread:- the log output you have just posted suggests you are still not using an xa-datasource configuration.

I know you can't post your source code but it should be easy enough for you to create a reproducible test case that contains just the minimum needed to show your issue.

You need to configure an XA capable MySql datasource yourself. We have already explained on this thread why it doesn't work "out of the box" - MySql does not properly support recovery. However, if you really do want to stick with MySql instead of supported datasources such as oracle or postgresql there are lots of resources on the web that show how to do it (for example go to your favourite seach page and type "how to create and manage datasources in as7").