<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div>Thanks!  Regarding (2), looks like the connector is considering it a "generic" error.  So if I set it to consider "generic" errors to be non-critical, it shows a warning on the UI but still saves the update to the MidPoint database.   Then when the issue
 is resolved, I can run the reconciliation task to update the target.  Looks good!</div>
<div><br>
</div>
<div>Thanks!</div>
<div><br>
</div>
<div>- Shilen</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>Pálos Gustáv <<a href="mailto:gustav.palos@evolveum.com">gustav.palos@evolveum.com</a>><br>
<span style="font-weight:bold">Reply-To: </span>"<a href="mailto:gustav.palos@evolveum.com">gustav.palos@evolveum.com</a>" <<a href="mailto:gustav.palos@evolveum.com">gustav.palos@evolveum.com</a>>, midPoint General Discussion <<a href="mailto:midpoint@lists.evolveum.com">midpoint@lists.evolveum.com</a>><br>
<span style="font-weight:bold">Date: </span>Wednesday, May 24, 2017 at 3:31 PM<br>
<span style="font-weight:bold">To: </span>midPoint General Discussion <<a href="mailto:midpoint@lists.evolveum.com">midpoint@lists.evolveum.com</a>><br>
<span style="font-weight:bold">Subject: </span>Re: [midPoint] Question about database connector and error handling<br>
</div>
<div><br>
</div>
<blockquote id="MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE" style="BORDER-LEFT: #b5c4df 5 solid; PADDING:0 0 0 5; MARGIN:0 0 0 5;">
<div>
<div>
<div dir="ltr">Hi folks,
<div><br>
</div>
<div>1) DBTable connector is only for one table (or view). </div>
<div>Can you create a DB view in your situation?</div>
<div><br>
</div>
<div>2) please see also connectorErrorCriticality on page:</div>
<div><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__wiki.evolveum.com_display_midPoint_Resource-2BDefinition-2BSections&d=DwMFaQ&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=sWqutME58phurE0oO57Icg&m=DxlmzpBKC_bz_2m0Ubfv4Wxsp6IybHA5bugYqd9_pxA&s=iBeMGeIoIvCFB7Sce2h1XtBEcxeFi7ilthL1e24sI4w&e=">https://wiki.evolveum.com/display/midPoint/Resource+Definition+Sections</a></div>
<div><br>
</div>
<div>Best regards,</div>
<div><br>
</div>
<div>Gustav</div>
<div><br>
<div class="gmail_extra"><br>
<div class="gmail_quote">2017-05-24 16:14 GMT+02:00 Shilen Patel <span dir="ltr">
<<a href="mailto:shilen@duke.edu" target="_blank">shilen@duke.edu</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif">
<div>Hi folks,</div>
<div><br>
</div>
<div>I am relatively new to using MidPoint and have recently started to look at how to integrate with a resource that stores user objects in a database table (Oracle).  I'm using the built-in DatabaseTableConnector (v1.4.2.0).  The database table is only a
 provisioning target.  So only outbound mappings and nothing inbound.  A have a couple of questions that I was hoping I could get some insight into.</div>
<div><br>
</div>
<div>1.  Most of the data needs to go to a single table.  However, there is one attribute that needs to go to another table.  The other table has a foreign reference to the primary table.  Does the built-in DatabaseTableConnector connector provide a means to
 insert a row into the secondary table when a row is inserted into the primary table?  If not, I think I know how to work around it.  I think I can easily extend the connector to do what I need to do there, but wanted to make sure there wasn't another way.</div>
<div><br>
</div>
<div>2.  I'm trying to figure out how error handling is supposed to work.  I've read through some of the background wiki pages, e.g. <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__wiki.evolveum.com_display_midPoint_Consistency-2Bmechanism&d=DwMFaQ&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=sWqutME58phurE0oO57Icg&m=DxlmzpBKC_bz_2m0Ubfv4Wxsp6IybHA5bugYqd9_pxA&s=Z3ZBX2EiJotrmGz1P73NBNvp0qICrZXrrYwmvvI2-zA&e=" target="_blank">https://wiki.evolveum.<wbr>com/display/midPoint/<wbr>Consistency+mechanism</a></div>
<div><br>
</div>
<div>I want to see what would happen when the target database is down (e.g. unexpected outage, scheduled maintenance, etc).  I figure when I have a lot of these external resources, I need to make sure a single resource having an issue doesn't make the whole
 MidPoint instance have issues.  So to force an error, I changed the database and jdbc connection url strings to have an invalid SID.   But then, using the web interface, if I try updating any attribute on a user that has a linked account for that resource,
 I get the following error:</div>
<div><br>
</div>
<div>
<p style="margin:0px;font-size:10px;font-family:Monaco;color:rgb(245,245,245);background-color:rgb(0,0,0)">
2017-05-24 09:37:02,270 [] [Thread-21] ERROR (com.evolveum.midpoint.<wbr>provisioning.ucf.impl.IcfUtil)<wbr>: ICF Exception java.lang.RuntimeException in connector:cbf461fb-12f8-4fb3-<wbr>b705-ceba4b7af0ab(ICF org.identityconnectors.<wbr>databasetable.<wbr>DatabaseTableConnector
 v1.4.2.0): resource:48b3a4c2-0a55-426d-<wbr>b21a-bed707837e72(TestDB) while getting object identified by ICF UID '102': java.sql.SQLException: Listener refused the connection with the following error:</p>
<p style="margin:0px;font-size:10px;font-family:Monaco;color:rgb(245,245,245);background-color:rgb(0,0,0)">
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor</p>
<p style="margin:0px;font-size:10px;font-family:Monaco;color:rgb(245,245,245);background-color:rgb(0,0,0);min-height:14px">
<br>
</p>
<p style="margin:0px;font-size:10px;font-family:Monaco;color:rgb(245,245,245);background-color:rgb(0,0,0)">
java.lang.RuntimeException: java.sql.SQLException: Listener refused the connection with the following error:</p>
<p style="margin:0px;font-size:10px;font-family:Monaco;color:rgb(245,245,245);background-color:rgb(0,0,0)">
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor</p>
<p style="margin:0px;font-size:10px;font-family:Monaco;color:rgb(245,245,245);background-color:rgb(0,0,0);min-height:14px">
<br>
</p>
<p style="margin:0px;font-size:10px;font-family:Monaco;color:rgb(245,245,245);background-color:rgb(0,0,0)">
        at org.identityconnectors.<wbr>dbcommon.SQLUtil$2.access(<wbr>SQLUtil.java:207) ~[dbcommon-1.4.2.0.jar:na]</p>
<p style="margin:0px;font-size:10px;font-family:Monaco;color:rgb(245,245,245);background-color:rgb(0,0,0)">
        at org.identityconnectors.common.<wbr>security.GuardedString.access(<wbr>GuardedString.java:116) ~[connector-framework-1.4.2.<wbr>18.jar:na]</p>
<p style="margin:0px;font-size:10px;font-family:Monaco;color:rgb(245,245,245);background-color:rgb(0,0,0)">
        at org.identityconnectors.<wbr>dbcommon.SQLUtil.<wbr>getDriverMangerConnection(<wbr>SQLUtil.java:198) ~[dbcommon-1.4.2.0.jar:na]</p>
<p style="margin:0px;font-size:10px;font-family:Monaco;color:rgb(245,245,245);background-color:rgb(0,0,0)">
        at org.identityconnectors.<wbr>databasetable.<wbr>DatabaseTableConnection.<wbr>getNativeConnection(<wbr>DatabaseTableConnection.java:<wbr>102) ~[connector-databasetable-1.4.<wbr>2.0.jar:na]</p>
<p style="margin:0px;font-size:10px;font-family:Monaco;color:rgb(245,245,245);background-color:rgb(0,0,0)">
        at org.identityconnectors.<wbr>databasetable.<wbr>DatabaseTableConnection.<wbr>createDBTableConnection(<wbr>DatabaseTableConnection.java:<wbr>74) ~[connector-databasetable-1.4.<wbr>2.0.jar:na]</p>
<p style="margin:0px;font-size:10px;font-family:Monaco;color:rgb(245,245,245);background-color:rgb(0,0,0)">
        at org.identityconnectors.<wbr>databasetable.<wbr>DatabaseTableConnector.<wbr>getConn(<wbr>DatabaseTableConnector.java:<wbr>212) ~[connector-databasetable-1.4.<wbr>2.0.jar:na]</p>
<p style="margin:0px;font-size:10px;font-family:Monaco;color:rgb(245,245,245);background-color:rgb(0,0,0)">
        at org.identityconnectors.<wbr>databasetable.<wbr>DatabaseTableConnector.<wbr>checkAlive(<wbr>DatabaseTableConnector.java:<wbr>192) ~[connector-databasetable-1.4.<wbr>2.0.jar:na]</p>
<p style="margin:0px;font-size:10px;font-family:Monaco;color:rgb(245,245,245);background-color:rgb(0,0,0)">
        at org.identityconnectors.<wbr>framework.impl.api.local.<wbr>ConnectorPoolManager$<wbr>ConnectorPoolHandler.<wbr>testObject(<wbr>ConnectorPoolManager.java:149) ~[connector-framework-<wbr>internal-1.4.2.18.jar:na]</p>
<p style="margin:0px;font-size:10px;font-family:Monaco;color:rgb(245,245,245);background-color:rgb(0,0,0)">
        at org.identityconnectors.<wbr>framework.impl.api.local.<wbr>ConnectorPoolManager$<wbr>ConnectorPoolHandler.<wbr>testObject(<wbr>ConnectorPoolManager.java:83) ~[connector-framework-<wbr>internal-1.4.2.18.jar:na]</p>
<p style="margin:0px;font-size:10px;font-family:Monaco;color:rgb(245,245,245);background-color:rgb(0,0,0)">
        at org.identityconnectors.<wbr>framework.impl.api.local.<wbr>ObjectPool.borrowObject(<wbr>ObjectPool.java:250) ~[connector-framework-<wbr>internal-1.4.2.18.jar:na]</p>
<p style="margin:0px;font-size:10px;font-family:Monaco;color:rgb(245,245,245);background-color:rgb(0,0,0)">
        at org.identityconnectors.<wbr>framework.impl.api.local.<wbr>operations.<wbr>ConnectorAPIOperationRunnerPro<wbr>xy.invoke(<wbr>ConnectorAPIOperationRunnerPro<wbr>xy.java:87) ~[connector-framework-<wbr>internal-1.4.2.18.jar:na]</p>
</div>
<div><br>
</div>
<div>I can provide the full stack trace if it would be useful.  I was expecting/hoping that any error on an individual outbound resource wouldn't fail the entire transaction.  I saw that there is a configuration option called "Rethrow all SQLExceptions", but
 that didn't seem to change this particular behavior.  I think ideally the update of the attribute in MidPoint would succeed and the update to the resource would either be automatically retried later or just ignored and handled by a reconciliation task.  Is
 that possible?  Am I doing something wrong?</div>
<div><br>
</div>
<div>Thanks!</div>
<span class="gmail-HOEnZb"><font color="#888888">
<div><br>
</div>
<div>- Shilen</div>
<div><br>
</div>
</font></span></div>
<br>
______________________________<wbr>_________________<br>
midPoint mailing list<br>
<a href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a><br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.evolveum.com_mailman_listinfo_midpoint&d=DwMFaQ&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=sWqutME58phurE0oO57Icg&m=DxlmzpBKC_bz_2m0Ubfv4Wxsp6IybHA5bugYqd9_pxA&s=gS-L0P-1VC6I3gk9tu0Ltebs5_zc4WdbBMdytO5WzgI&e=" rel="noreferrer" target="_blank">http://lists.evolveum.com/<wbr>mailman/listinfo/midpoint</a><br>
<br>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div class="gmail_signature">
<div dir="ltr">
<div>Gustáv Pálos</div>
<div>Identity Engineer</div>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__evolveum.com_&d=DwMFaQ&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=sWqutME58phurE0oO57Icg&m=DxlmzpBKC_bz_2m0Ubfv4Wxsp6IybHA5bugYqd9_pxA&s=gyonHIcluYRWlywc5GWl1yWltABL5htFg3D3_vNU7Xk&e=" rel="noreferrer" style="color:rgb(17,85,204);font-size:12.8px" target="_blank">evolveum.com</a><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</span>
</body>
</html>