Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-52323

Transaction rollback doesn't work with sharding enabled

    Details

      Description

      Steps to reproduce:

      1. Enable sharding, the test was executed with three shards using MySQL in the three dd.bb.

      2. Deploy the attached sample-service-builder-portlet.war, that allows you to manage "Foo" entities.

      The service contains this method:

      com.liferay.sampleservicebuilder.service.impl.FooLocalServiceImpl.java
      	public Foo deleteFoo(long fooId, boolean exception) throws SystemException {
      		Foo foo = fooPersistence.fetchByPrimaryKey(fooId);
      
      		if (foo == null) {
      			return null;
      		}
      
      		foo = deleteFoo(foo);
      
      		if (exception) {
      			throw new SystemException("Unable to delete fooId " +fooId );
      		}
      
      		return foo;
      	}
      

      3. Add a Foo.

      4. Try to delete the Foo via the method that throws an exception (exception=true), just using "Delete with an exception" action in the foo list

      Result: Rollback is not working and the Foo is removed from SSB_Foo table in data base.

      Also, the cache in not cleared fine and it seems that the Foo exists (see attached error.png), however if you clear cache from Control Panel > Server Administration, the foo item disapear.

      Expected: Rollback works fine and the foo is not deleted.

      NOTES:
      a) It can not be tested in master because the portlet doesn't deploy succesfully with sharding enabled.
      b) The portlet works as expected without sharding.

        Attachments

          Activity

            People

            • Assignee:
              jorge.ferrer Jorge Ferrer
              Reporter:
              jose.jimenez Jose Jimenez
              Participants of an Issue:
              Recent user:
              Jorge Ferrer
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                2 years, 43 weeks, 2 days ago

                Packages

                Version Package