Skip to content

Commit

Permalink
Fix postgres error with adding new org
Browse files Browse the repository at this point in the history
  • Loading branch information
dewniMW committed Nov 20, 2023
1 parent a88e1f6 commit 94e5de2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,14 @@ public void addSharedApplication(String mainAppId, String ownerOrgId, String sha

NamedJdbcTemplate namedJdbcTemplate = getNewTemplate();
try {
String shareWithAllChildrenValue = getShareWithAllChildrenValue(shareWithAllChildren);
namedJdbcTemplate.withTransaction(template -> {
template.executeInsert(INSERT_SHARED_APP, namedPreparedStatement -> {
namedPreparedStatement.setString(DB_SCHEMA_COLUMN_NAME_MAIN_APP_ID, mainAppId);
namedPreparedStatement.setString(DB_SCHEMA_COLUMN_NAME_OWNER_ORG_ID, ownerOrgId);
namedPreparedStatement.setString(DB_SCHEMA_COLUMN_NAME_SHARED_APP_ID, sharedAppId);
namedPreparedStatement.setString(DB_SCHEMA_COLUMN_NAME_SHARED_ORG_ID, sharedOrgId);
namedPreparedStatement.setString(DB_SCHEMA_COLUMN_NAME_SHARE_WITH_ALL_CHILDREN,
shareWithAllChildrenValue);
namedPreparedStatement.setBoolean(DB_SCHEMA_COLUMN_NAME_SHARE_WITH_ALL_CHILDREN,
shareWithAllChildren);
}, null, false);
return null;
});
Expand Down Expand Up @@ -212,13 +211,12 @@ public void updateShareWithAllChildren(String mainApplicationId, String ownerOrg
boolean shareWithAllChildren) throws OrganizationManagementException {
NamedJdbcTemplate namedJdbcTemplate = getNewTemplate();
try {
String shareWithAllChildrenValue = getShareWithAllChildrenValue(shareWithAllChildren);
namedJdbcTemplate.withTransaction(template -> {
template.executeInsert(UPDATE_SHARE_WITH_ALL_CHILDREN, namedPreparedStatement -> {
namedPreparedStatement.setString(DB_SCHEMA_COLUMN_NAME_MAIN_APP_ID, mainApplicationId);
namedPreparedStatement.setString(DB_SCHEMA_COLUMN_NAME_OWNER_ORG_ID, ownerOrganizationId);
namedPreparedStatement.setString(DB_SCHEMA_COLUMN_NAME_SHARE_WITH_ALL_CHILDREN,
shareWithAllChildrenValue);
namedPreparedStatement.setBoolean(DB_SCHEMA_COLUMN_NAME_SHARE_WITH_ALL_CHILDREN,
shareWithAllChildren);
}, null, false);
return null;
});
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@
<carbon.user.api.imp.pkg.version.range>[1.0.1, 2.0.0)</carbon.user.api.imp.pkg.version.range>
<carbon.user.core.imp.pkg.version.range>[4.7.0, 5.0.0)</carbon.user.core.imp.pkg.version.range>

<carbon.database.utils.version>2.0.13</carbon.database.utils.version>
<carbon.database.utils.version>2.1.6</carbon.database.utils.version>
<org.wso2.carbon.database.utils.version.range>[2.0.0,3.0.0)</org.wso2.carbon.database.utils.version.range>

<carbon.identity.auth.version>1.4.47</carbon.identity.auth.version>
Expand Down

0 comments on commit 94e5de2

Please sign in to comment.