-
Type:
Regression Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: 7.0.0 DXP SP2, Master
-
Fix Version/s: 7.0.0 DXP FP10, 7.0.0 DXP SP2, 7.0.3 CE GA4, 7.0.0 DXP FP29, 7.0.4 CE GA5, 7.1.X, Master
-
Branch Version/s:7.0.x
-
Backported to Branch:Committed
-
Story Points:1
-
Fix Priority:5
-
Git Pull Request:
Description
A portlet's ability to write/read from an external database is broken as of LPS-68980. This happens because LPS-68980 unified all the different transactions, without accounting for the fact that the user may have a custom portlet that doesn't touch the Liferay database at all.
Please note that the table ssb_foo is generated in the local database. Service builder should not do this since the external database is being used. This might be a separate bug that should be investigated, as well.
Steps to reproduce
- Create two databases - a local database and an external database.
- From the attached sample-blade-servicebuilder-portal-properties.zip, add the three modules to osgi/modules in your bundle.
- Add the following properties to my portal-ext.properties (modify these for your environment):
jdbc.test.driverClassName=com.mysql.jdbc.Driver jdbc.test.url=jdbc:mysql://localhost:3306/[external_DB_name]?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false jdbc.test.username=root jdbc.test.password=test jdbc.default.driverClassName=com.mysql.jdbc.Driver jdbc.default.url=jdbc:mysql://localhost:3306/[local_DB_name]?characterEncoding=UTF-8&dontTrackOpenResources=true&holdResultsOpenOverStatementClose=true&useFastDateParsing=false&useUnicode=true jdbc.default.username=root jdbc.default.password=test
- Create the ssb_foo table on the external database with this script:
create table SSB_Foo ( uuid_ VARCHAR(75) null, fooId BIGINT not null primary key, groupId BIGINT, companyId BIGINT, userId BIGINT, userName VARCHAR(75) null, createDate DATE null, modifiedDate DATE null, field1 VARCHAR(75) null, field2 BOOLEAN, field3 INTEGER, field4 DATE null, field5 VARCHAR(75) null );
- Start the portal.
- Add the sample portlet from the Sample category. Note that the name of this particular portlet is blank under the category Sample.
- Add an object in the portlet
Expected Result: As is seen in a version of the portal prior to
LPS-68980, the object is written to the external database and is displayed in the portlet.
Actual Result: The object is written to the local database's ssb_foo table.
Reproduced in
master? Yes, issue reproduced in master (cd83aa91d9654b8b08eef75dbc6eb54d1b97e705)
ee-7.0.x? Yes, issue reproduced in ee-7.0.x (727286e5e436c0f76f5efd291123cea2379d47c4)
- is caused by
-
LPS-68980 Create PortletTransactionManager to do proper tx bridging across portal and components and add in verification support to highlight out wrong tx manager usages
- Closed