Forum Stats

  • 3,734,166 Users
  • 2,246,899 Discussions
  • 7,857,145 Comments

Discussions

Atomic transaction between Web Services (ws-at and ws-coor) deployed on Glassfish 3.1.2.2

Hello,


We use atomic transaction between Web Services (ws-at and ws-coor) deployed on Glassfish. In the Glassfish version 2.1.1 everything works and in the version 3.1.2 it’s not working.

We use the following flow:

• A client application (Java servlet), that creates a global transaction and invokes a web service that creates a record in an Oracle database and returns the id just created for the client application.

• After that the same client application invokes a second web service in the same transactional context using the id of the record created in the first web service to make a query of that record, in the glassfish version 2.1.1 the web service finds the record, in the Oracle Glassfish application server 3.1.2.2 it doesn’t find it.

The web services were developed with:

• Java 1.7

• Session Ejb Stateless with a CMT EntityManager with hibernate 4, to make the query and to persist the record.

• The session Ejb was published like a web service using the annotations for implementing the ws-at:

@WebService

@Stateless

@Transactional(value=Transactional.TransactionFlowType.MANDATORY,version=com.sun.xml.ws.api.tx.at.Transactional.Version.WSAT10,enabled=true)

@TransactionAttribute(TransactionAttributeType.REQUIRED)

@TransactionManagement(TransactionManagementType.CONTAINER

• In the application server a connection pool was created for the jndi TESTEXA, with the xa driver of oracle.

Also the same application was tested on Glassfish 4, and we got the same result, the second web service doesn’t find the record created by the first web service.

We made another test, configuring the jvm option on the glassfish:

-DALLOW_MULTIPLE_ENLISTS_DELISTS=true (the default is false).

That option makes that the second web service sees the data persisted by the first web service, but it happens only because with that option the data of the first web service is persisted to the data base just after the invocation of the first web service ends, and not at the end of the global transaction, because of that when an exception is throw on the second web service the data created in the first web services doesn’t rollback.

We need help to know the configuration differences between the two versions of Glassfish( Glassfish 2.1.1 and Glassfish 3.1.2) , required for using Ws-AT e WS-Coor , and the difference that may exist in the configuration of the connection pool, i think that is impossibel that it doen't work on glassfish 3.1.2 and works on 2.1.1, anyone can help me with this plz? , we have a client that is watting for alone time for upgrade of glassfish version.


thanks.

Tagged:
This discussion has been closed.