users@jersey.java.net

Re: [Jersey] Spring, transaction and Jersey test framework

From: Paul Sandoz <Paul.Sandoz_at_oracle.com>
Date: Thu, 21 Oct 2010 09:39:05 +0200

Hi Leo,

I have not observed such an issue, but i suspect like yourself it
could be a Grizzly issue.

There may be a bug in Grizzly's servlet support for registering and
processing context listeners. Is this transaction configuration
something that registers a request context listener, so that when the
request is processed the listener gets called?

Jersey currently uses Grizzly version 1.9.18-i perhaps you could try
1.9.19 and see if that fixes things?

Paul.

On Oct 20, 2010, at 3:59 PM, Leo Geoffroy wrote:

> Hello,
> I'm using the jersey-test-framework to test my Jersey Webservice.
> I launch my unit tests with JUNIT4 using the spring annotations
> @Transactional and @TransactionConfiguration(defaultRollback = true)
> to avoid putting unused test data into database.
> Apparently, these annotations are not taken into account by my
> GrizzlyWebTestContainer because data processed in my webservice is
> inserted in my database and not removed afterward.
> It sounds like it is a context problem : Grizzly Webapp and JUnit
> test are not using the same context, and then are working in
> differents transactions.
>
> Have you ever faced this problem? Any solution?
> Thanks in advance,
> Leo