Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Passive Connectors - load balancing - broken pipe issues

137 views
Skip to first unread message

michele

unread,
Nov 20, 2006, 1:27:31 PM11/20/06
to
Grrrrr...

I need to establish my passive connector prior to my call. What I have
is a process that is always running, so it is possible for the
connection to be broken to other dB's during run-time. I have fixed
all of my active connectors, by adding the infamous:

// terminate connection & re-establish
try {
thisConnector.connector.terminate();
} catch (error) { task.logmsg("terminate failed"); }

thisConnector.connector.initialize(null);

and that works just great. Now, the problem is when I have to call a
passive connector, which is load balanced(but that doesn't matter to
IDI) and even if I repeat the above code in the passive connector's
Before Execute hook, I will get a broken pipe error. I receive the
error message, not in the passive connector, but in the connector that
is trying to call the passive one. So, I am assuming that I have to
terminate & then establish a connector to the passive connector BEFORE
I issue the following statement:

work.setAttribute("EAGLENUMBER", work.getString("XMLEN"));
work.setAttribute("FAILED_SYSTEM","LDAP");
work.setAttribute("XML_PAYLOAD","");
work.setAttribute("FAILURE_DATE","");
work.setAttribute("NUM_FAILURES",1);
ErrorRetryAdd.add(work); <== this is the passive connector.


So, how do I do this? Please help.

thanks so much

michele mueller
boston college


error messages:
2006-11-20 11:19:50,719 ERROR [AssemblyLine.PasswordSync-24603818] -
[iPlanetUpdate] while evaluating "iPlanetUpdate.update_ok"
java.sql.SQLException: Io exception: Broken pipe
at
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:255)
at
oracle.jdbc.driver.T4CConnection.doCommit(T4CConnection.java:533)
at
oracle.jdbc.driver.PhysicalConnection.commit(PhysicalConnection.java:1119)
at com.ibm.di.connector.JDBCConnector.putEntry(Unknown Source)
at com.ibm.di.server.AssemblyLineComponent.add1(Unknown Source)
at com.ibm.di.server.AssemblyLineComponent.add(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
at
org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:228)
at
org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1222)
at
org.mozilla.javascript.gen.c23.call(iPlanetUpdate.update_ok:39)
at org.mozilla.javascript.gen.c23.exec(iPlanetUpdate.update_ok)
at
com.ibm.di.server.AttributeMapping$SingleAttributeMap.eval(Unknown
Source)
at com.ibm.di.server.AttributeMapping.eval(Unknown Source)
at com.ibm.di.server.AssemblyLineComponent.trigger(Unknown
Source)
at com.ibm.di.server.AssemblyLineComponent.trigger(Unknown
Source)
at
com.ibm.di.server.AssemblyLineComponent.handleSuccess(Unknown Source)
at
com.ibm.di.server.AssemblyLine.msExecuteNextConnector(Unknown Source)
at com.ibm.di.server.AssemblyLine.executeMainStep(Unknown
Source)
at com.ibm.di.server.AssemblyLine.executeMainLoop(Unknown
Source)
at com.ibm.di.server.AssemblyLine.executeMainLoop(Unknown
Source)
at com.ibm.di.server.AssemblyLine.executeAL(Unknown Source)
at com.ibm.di.server.AssemblyLine.run(Unknown Source)
2006-11-20 11:19:50,719 INFO [AssemblyLine.PasswordSync-24603818] -
[iPlanetUpdate] handleException: update, java.sql.SQLException: Io
exception: Broken pipe
2006-11-20 11:19:50,720 INFO [AssemblyLine.PasswordSync-24603818] -
[iPlanetUpdate] Trigger update_fail [1]
2006-11-20 11:19:50,720 INFO [AssemblyLine.PasswordSync-24603818] -
[iPlanetUpdate] Script is:
if ( work.getString("XMLACTION") != "HINT" )
{
var subj="TEST ERROR Password Sync";
var body="There was an update error for user "+
work.getString("XMLUSER") + " in the iPlanetUpdate connector";
body = body + "\n\nPlease investigate. The ReplayAssembly Line will
send the data again.";
body = body + "\n\nWORK: " + work;

// for test system
var recip = new Array(1);
recip[0] = "mue...@bc.edu";
new Packages.edu.bc.idi.util.Email.sendEmail(subj,body,recip);

// for prod system
// new Packages.edu.bc.idi.util.Email.sendEmail(subj,body);
}

try {
thisConnector.connector.terminate();
} catch (error) { task.logmsg("terminate failed"); }

thisConnector.connector.initialize(null);
work.setAttribute("EAGLENUMBER", work.getString("XMLEN"));
work.setAttribute("FAILED_SYSTEM","LDAP");
work.setAttribute("XML_PAYLOAD","");
work.setAttribute("FAILURE_DATE","");
work.setAttribute("NUM_FAILURES",1);
ErrorRetryAdd.add(work);


2006-11-20 11:19:54,298 ERROR [AssemblyLine.PasswordSync-24603818] -
[iPlanetUpdate] while evaluating "iPlanetUpdate.update_fail"
java.sql.SQLException: Closed Connection
at
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
at
oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:840)
at
oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:759)
at
com.ibm.di.connector.JDBCConnector$PreparedSql.<init>(Unknown Source)
at com.ibm.di.connector.JDBCConnector.putEntry(Unknown Source)
at com.ibm.di.server.AssemblyLineComponent.add1(Unknown Source)
at com.ibm.di.server.AssemblyLineComponent.add(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
@ at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
at
org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:228)
at
org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1222)
at
org.mozilla.javascript.gen.c62.call(iPlanetUpdate.update_fail:27)
at
org.mozilla.javascript.gen.c62.exec(iPlanetUpdate.update_fail)
at
com.ibm.di.server.AttributeMapping$SingleAttributeMap.eval(Unknown
Source)
at com.ibm.di.server.AttributeMapping.eval(Unknown Source)
at com.ibm.di.server.AssemblyLineComponent.trigger(Unknown
Source)
at com.ibm.di.server.AssemblyLineComponent.trigger(Unknown
Source)
at
com.ibm.di.server.AssemblyLineComponent.handleException(Unknown Source)
at
com.ibm.di.server.AssemblyLine.msExecuteNextConnector(Unknown Source)
at com.ibm.di.server.AssemblyLine.executeMainStep(Unknown
Source)
at com.ibm.di.server.AssemblyLine.executeMainLoop(Unknown
Source)
at com.ibm.di.server.AssemblyLine.executeMainLoop(Unknown
Source)
at com.ibm.di.server.AssemblyLine.executeAL(Unknown Source)
at com.ibm.di.server.AssemblyLine.run(Unknown Source)
2006-11-20 11:19:54,300 ERROR [AssemblyLine.PasswordSync-24603818] -
Error in: NextConnectorOperation: java.sql.SQLException: Closed
Connection

Eddie Hartman

unread,
Nov 21, 2006, 6:03:55 AM11/21/06
to
Hi Michele,

First off, why not just use the Connector Auto-reconnect feature
for your other Connectors. Check out the tab called "Connection Errors"
in 6.1 (or Reconnect in 6.0).

For your passive Connector I would wrap your call in while-loop and
try-catch:

// I would create a new Entry instead of re-using work, which could
// contain other data.
//
var errEntry = system.newEntry();
errEntry.setAttribute("EAGLENUMBER", work.getString("XMLEN"));
errEntry.setAttribute("FAILED_SYSTEM","LDAP");
errEntry.setAttribute("XML_PAYLOAD","");
errEntry.setAttribute("FAILURE_DATE","");
errEntry.setAttribute("NUM_FAILURES",1);

while (true) {
try {
ErrorRetryAdd.add(errEntry.); <== this is the passive
connector.
break; // might want to have a retry count and system.sleep()
between
} catch (excptn) {
task.logmsg("Error writing error: " + excptn);
thisConnector.connector.initialize(null); // or wrap this as
well to catch the error
}

And of course you put this in a function in your Script library so you
can
easily reuse it across your ALs :)

Hope this helps!

-Eddie

Eddie Hartman

unread,
Nov 21, 2006, 10:24:22 AM11/21/06
to
Hi again, Michele,

A thought struck me (ouch) that since you are using the
AssemblyLineComponent "add()" method, instead of the
"putEntry()" of the underlying Connector Interface, then you
get access to Hooks and Output Map, and I believe you
also get the built-in Reconnect functionality.

So it should be enough to setup the Connection Errors
retry feature and then just do your call to:

ErrorRetryAdd.add(errEntry.); <== this is the passive

-Eddie

michele

unread,
Nov 21, 2006, 10:31:36 AM11/21/06
to
Hi Eddie

the reconnect functionality does not work when IDI does not think the
connection is broken. the problem lies with the fact that the other
server has broken the connection, but IDI thinks everything is
hunky-dory when in fact, it is not. That is why I have to use that
terminate & initialize connections everytime for every server that I
connect to. I have the reconnect option on, but it doesn't work when
the connection is broken and IDI isn't aware of it(it thinks it is
still open)

I will try your first suggestion and let you know.

thanks
michele mueller
boston college

michele

unread,
Nov 21, 2006, 10:34:22 AM11/21/06
to
fyi - I am still stuck on idi6.0 as our systems folks are having
massive problems with installing idi6.1

is the reconnect functionality more robust on idi6.1 - for example,
will idi be intelligent enough to know when there really is a broken
connection?

michele

unread,
Nov 21, 2006, 11:10:43 AM11/21/06
to

Hi Eddie

I noticed this in the code you wrote:
thisConnector.connector.initialize

I am not having a problem with the calling connector - I am having the
problem with the passive connector. I can only assume that calling the
passive connector ignores any terminate & init commands that I put in
the Before Execute hook in the passive connector.

The error messages from my fist posting shows that the error is
occuring in the calling routine, yet there is no problem with that
calling routine's connection. It is telling me I have a broken
pipe(connection) on the passive connector.

How can I terminate & init the passive connector prior to my call to
the passive connector?

michele

unread,
Nov 21, 2006, 11:23:39 AM11/21/06
to
Hi Eddie
your first solution didn't work for me, nor do I think that
initializing the calling connector is what I am looking for. Thank
you for supplying me with the code, however. I think I will find it
useful in other areas. I do need to know how to term & init a passive
connector's connection in the calling connector.

I got this error message even though I did define excptn:


2006-11-21 11:10:57,510 INFO [AssemblyLine.PasswordSync-1008406118] -
[iPlanetUpdate] Script is:
var excptn;

work.setAttribute("EAGLENUMBER", work.getString("XMLEN"));
work.setAttribute("FAILED_SYSTEM","LDAP");
work.setAttribute("XML_PAYLOAD","");
work.setAttribute("FAILURE_DATE","");
work.setAttribute("NUM_FAILURES",1);

while (true) {
try {
ErrorRetryAdd.add(work); <== passive connector.


break; // might want to have a retry count and system.sleep()
between
} catch (excptn) {
task.logmsg("Error writing error: " + excptn);
thisConnector.connector.initialize(null);
}

2006-11-21 11:10:57,851 ERROR [AssemblyLine.PasswordSync-1008406118] -
[iPlanetUpdate] while evaluating "iPlanetUpdate.update_ok"
undefined: syntax error (iPlanetUpdate.update_ok; line 12)
at
org.mozilla.javascript.NativeGlobal.constructError(NativeGlobal.java:580)
at
org.mozilla.javascript.TokenStream.reportSyntaxError(TokenStream.java:1370)
at org.mozilla.javascript.Parser.reportError(Parser.java:75)
at org.mozilla.javascript.Parser.primaryExpr(Parser.java:1355)
at org.mozilla.javascript.Parser.memberExpr(Parser.java:1152)
at org.mozilla.javascript.Parser.unaryExpr(Parser.java:1065)
at org.mozilla.javascript.Parser.mulExpr(Parser.java:1012)
at org.mozilla.javascript.Parser.addExpr(Parser.java:995)
at org.mozilla.javascript.Parser.shiftExpr(Parser.java:982)
at org.mozilla.javascript.Parser.relExpr(Parser.java:964)
at org.mozilla.javascript.Parser.eqExpr(Parser.java:951)
at org.mozilla.javascript.Parser.bitAndExpr(Parser.java:940)
at org.mozilla.javascript.Parser.bitXorExpr(Parser.java:928)
at org.mozilla.javascript.Parser.bitOrExpr(Parser.java:916)
at org.mozilla.javascript.Parser.andExpr(Parser.java:904)

at org.mozilla.javascript.Parser.condExpr(Parser.java:875)
at org.mozilla.javascript.Parser.assignExpr(Parser.java:856)
at org.mozilla.javascript.Parser.expr(Parser.java:844)
at
org.mozilla.javascript.Parser.statementHelper(Parser.java:741)
at org.mozilla.javascript.Parser.statement(Parser.java:334)
at org.mozilla.javascript.Parser.statements(Parser.java:262)
at
org.mozilla.javascript.Parser.statementHelper(Parser.java:723)
at org.mozilla.javascript.Parser.statement(Parser.java:334)
at
org.mozilla.javascript.Parser.statementHelper(Parser.java:566)
at org.mozilla.javascript.Parser.statement(Parser.java:334)
at org.mozilla.javascript.Parser.statements(Parser.java:262)
at
org.mozilla.javascript.Parser.statementHelper(Parser.java:723)
at org.mozilla.javascript.Parser.statement(Parser.java:334)
at
org.mozilla.javascript.Parser.statementHelper(Parser.java:457)
at org.mozilla.javascript.Parser.statement(Parser.java:334)
at org.mozilla.javascript.Parser.parse(Parser.java:133)
at org.mozilla.javascript.Context.compile(Context.java:1787)
at org.mozilla.javascript.Context.compile(Context.java:1735)
at
org.mozilla.javascript.Context.compileReader(Context.java:852)
at
org.mozilla.javascript.Context.evaluateReader(Context.java:770)
at
org.mozilla.javascript.Context.evaluateString(Context.java:737)
at
com.ibm.bsf.engines.javascript.JavaScriptEngine.eval(JavaScriptEngine.java:50)
at com.ibm.bsf.util.BSFEngineImpl.exec(Unknown Source)
at com.ibm.bsf.BSFManager.exec(Unknown Source)


at
com.ibm.di.server.AttributeMapping$SingleAttributeMap.eval(Unknown
Source)
at com.ibm.di.server.AttributeMapping.eval(Unknown Source)
at com.ibm.di.server.AssemblyLineComponent.trigger(Unknown
Source)
at com.ibm.di.server.AssemblyLineComponent.trigger(Unknown
Source)
at
com.ibm.di.server.AssemblyLineComponent.handleSuccess(Unknown Source)
at
com.ibm.di.server.AssemblyLine.msExecuteNextConnector(Unknown Source)
at com.ibm.di.server.AssemblyLine.executeMainStep(Unknown
Source)
at com.ibm.di.server.AssemblyLine.executeMainLoop(Unknown
Source)
at com.ibm.di.server.AssemblyLine.executeMainLoop(Unknown
Source)
at com.ibm.di.server.AssemblyLine.executeAL(Unknown Source)
at com.ibm.di.server.AssemblyLine.run(Unknown Source)

2006-11-21 11:10:57,870 INFO [AssemblyLine.PasswordSync-1008406118] -
[iPlanetUpdate] handleException: update, undefined: syntax error
(iPlanetUpdate.update_ok; line 12)
2006-11-21 11:10:57,871 INFO [AssemblyLine.PasswordSync-1008406118] -
[iPlanetUpdate] Trigger update_fail [1]
2006-11-21 11:11:00,123 INFO [AssemblyLine.PasswordSync-1008406118] -
[iPlanetUpdate] Script is:

Eddie Hartman

unread,
Nov 22, 2006, 8:34:31 AM11/22/06
to
Hi Michele,

First off, PLEASE have your system folks raise a PMR
on the installer if it is giving you grief!!! Only way this will
get improved (it is out of our hands).

As for the error dump, here is what I am seeing:

ErrorRetryAdd.add(work); <== passive connector.

I think you forgot "//" to signify the comment ;)

Also, Passive State only means that the AL logic will
not drive the Connector during processing. Calling
terminate() + initialize() works just the same as for
Enabled Connectors.

And where is my head these days?! There is a Boolean
AssemblyLineComponent method called "reconnect()".
So instead of doing terminate/initialize , just do this:

var retries = 5;
while (!ErrorRetryAdd.reconnect()) {
system.sleep( mySleepInterval);
if (--retries <= 0)
break;
}

to add some of your own auto-reconnect logic ;)

-Eddie

0 new messages