|[eclipselink-users] Re: Problem with container-based transactions
Hi Ellen,There are a number of ways TopLink Essentials is automatically integrated into GlassFish/SunAS. We are hoping that in future versions of GlassFish we can arrange for similar automatic integrations. In the meantime, as you can see, there are a few settings required.
Try adding the following property to your persistence unit and let me know what your results are:
<property name="eclipselink.target-server" value="SunAS9"/>Hopefully the addition of that property will allow EclipseLink to properly access the GlassFish transaction mechanism.
Thanks for your patience, Tom Ellen Kraffmiller wrote:
Hi Tom,I've done some further testing, and have run into other problems concerning transactions. When I use EclipseLink in our application, we are getting some strange behavior:1) When I call a session bean method does a simple update of an entity, the method executes without any errors, but the data is not saved to the database. (This method works correctly when I use Toplink Essentials). I tried adding a transaction type of REQUIRED (even though that should be the type by default), but I still get the same behavior.2) I have a stateful session bean that uses an extended persistence context to edit an entity. When I call the method to persist the entity (which has a transaction type of REQUIRES_NEW) I get javax.persistence.TransactionRequiredException: Exception Description: No transaction is currently active (I don't get this error with Toplink Essentials.)3) We have some session bean methods that call em.flush() to save changes to the database - these methods also trigger the exception 'javax.persistence.TransactionRequiredException: Exception Description: No transaction is currently active', even though they are in methods that by default should be TransactionType REQUIRED, because I don't have a specific transaction type defined on the method or the session bean.4) We have a session bean method that creates a new entity, then within the same persistence context calls another method that calls a Java Persistance Query. The results of the query don't contain the new entity just created. This is different from the behavior in TopLink Essentials, and from what I've read the correct behavior is that a Query should always return results that reflect the current state of the persistence context, by flushing changes to the database, if necessary.Sorry if this is overloading you with information, I just wanted to let you know what I've run into. They seem to all be related to a problem creating the container based transaction.Thanks, Ellen
Back to the top