Re : Powershell does NOT return errorcode to CMD file thats invoking PS

Hello there,
I am trying to return the exit code from PS back to CMD file that invokes the PS. Funny thing is PS does print exit code as 1 but CMD files still shows errorlevel as 0..... not sure what is causing it. The catch block in PS , I attempted to make generic
and seems catch the exception correctly and is also printing the errorcode as 1 in PS. but upon exit 1 in PS , CMD file still shows %ERRORCODE% as 0 !
Appreciate suggestions on this.
CMD File
:DBLOGIN
CALL login.cmd username
if %errorlevel% == 1 goto badend
SET PWORD=%PASS_WORD%
:ADLOGIN
CALL AD_login.cmd %5
if %errorlevel% == 1 goto badend
SET AD_PWORD=%AD_PASS_WORD%
SET PS_DIR=%1
SET ROOT_DIR=%2
SET UNAME=%3
SET CONNSTR=%4
SET ELE_UNAME=%5
SET GROUPNAME=%6
SET GROUPDOMAINNAME=%7
SET DIR=%8
d:
cd %ROOT_DIR%
%PS_DIR% -File "%ROOT_DIR%\adsync.ps1" %UNAME% %PWORD% %CONNSTR% %ELE_UNAME% %AD_PWORD% %GROUPNAME% %GROUPDOMAINNAME% %DIR% 2>&1 | more
echo error level is %ERRORLEVEL%
if %ERRORLEVEL% NEQ 0 GOTO badend
GOTO ENDPROC
:badend
REM BAD END %ERRORLEVEL%
@ECHO OFF & ECHO. & DATE /T & TIME /T & ECHO. & @ECHO ON
exit /B 55
:ENDPROC
REM ACCEPTABLE RETURN CODE FOUND
REM Error Level - %ERRORLEVEL%
@ECHO OFF & ECHO. & DATE /T & TIME /T & ECHO. & @ECHO ON
EXIT /B 0
The powershell code is : 
Import-Module ActiveDirectory
$returncode =0;
try
$forestName = ([System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest()).Name
$ADsPath = [ADSI]"GC://$forestName"
$Search = New-Object System.DirectoryServices.DirectorySearcher($ADsPath)
$OraClientDir=$args[7];
echo $OraClientDir;
[Reflection.Assembly]::LoadFile("$($OraClientDir)Oracle.DataAccess.dll")
$DBUserName=$args[0];
$DBPassword=$args[1];
$DBSourceName=$args[2];
$eleuser=$args[3];
echo $eleuser;
$elepword=ConvertTo-SecureString -String $args[4] -AsPlainText -Force;
echo $elepword;
$Credentials=New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $eleuser,$elepword;
echo $Credentials;
$ADGroupName=$args[5];
echo $ADGroupName;
$ADGroupServerName=$args[6];
echo $ADGroupServerName;
$ADGroupServerString="$($ADGroupName) -server ""$($ADGroupServerName)""" ;
echo $ADGroupServerString;
Write-Host \n;
echo " Start time is : $(Get-Date -format "yyyy:MM:dd hh:mm:ss:tt") ";
$con=New-Object Oracle.DataAccess.Client.OracleConnection("Data Source=$DBSourceName;User Id=$DBUserName;Password=$DBPassword")
$con.open()
$cmd=$con.CreateCommand()
$cmd.CommandText="SELECT blah blah SQL"
$rdr=$cmd.ExecuteReader()
$found= $false;
$counter=0;
$counterNew=0;
$group=Get-ADGroup $ADGroupName -server $ADGroupServerName;
$members = @()
Get-ADGroupMember -Identity $group | Select-Object -ExpandProperty sAMAccountName |ForEach-Object {$members += $_};
$path="\logs\log_$(Get-Date -format yyyy_MM_dd_hh_mm_ss_tt).log";
Write-Host "The total members in group " $group " are " $members.length;
Add-Content -Path $path -Value ("The total members in group " + $group + " are " + $members.length ) -Force;
while ($rdr.Read())
for ($i=0;$i -lt $rdr.FieldCount ; $i++)
$found= $false;
$s=$rdr.GetValue($i);
$Search.Filter = "(&(objectCategory=User)(SamAccountName=$s))"
if ($Search.FindAll().Count -eq 0)
Add-Content -Path $path -Value "The user $s does NOT exists in AD global catalog" -Force;
Write-Host "The user : " $s "does NOT exists in AD global catalog" ;
$counter++;
else {
try {
foreach ($res in $Search.FindAll())
$User = $res.GetDirectoryEntry();
Add-Content -Path $path -Value ("The user " + $User.SamAccountName + " Found in AD global catalog") -Force;
Write-Host "The user distinguished name is : " $User.DistinguishedName " Found in AD global catalog" ;
$DC = $User.DistinguishedName.ToString();
$DCString = $DC.SubString($DC.IndexOf("DC="));
$FQDN = $DCString.replace("DC=","").replace(",",".");
# Add-Content -Path $path -Value $FQDN -Force;
$found = $true;
if ( ($found) -and ($members -notcontains $s))
$checkuser= Get-ADUser $User.SamAccountName.ToString() -Server $FQDN ;
Add-ADGroupMember $group -Members $checkuser -Server $ADGroupServerName -Credential $Credentials;
Add-Content -Path $path -Value ("Added user: " + $User.SamAccountName ) -Force ;
Write-Host "Added user: " $User.SamAccountName;
$counterNew++;
} catch [Exception] {
Write-Host $_.Exception.Message "is inner catch";
$returncode =1;
Add-Content -Path $path -Value "Total of : $counterNew users users have been added " -Force;
Write-Host "Total of : $counterNew users users have been added to AD Group";
Add-Content -Path $path -Value "Total of : $counter users do NOT exist in Windows AD global catalog";
Write-Host "Total of : $counter users do NOT exist in Windows AD global catalog";
catch [Exception] {
Write-Host $_.Exception.Message "is outer catch";
$returncode =1;
Write-Host \n;
echo " End time is : $(Get-Date -format "yyyy:MM:dd hh:mm:ss:tt") ";
Write-Host "value of return code is " $returncode;
exit $returncode;

Maybe the webpages below can help someone compose a workaround
https://connect.microsoft.com/PowerShell/feedback/details/750653/powershell-exe-doesn-t-return-correct-exit-codes-when-using-the-file-option
https://connect.microsoft.com/PowerShell/feedback/details/750653/powershell-exe-doesn-t-return-correct-exit-codes-when-using-the-file-option#

Similar Messages

  • Runtime.getRuntime().exec() does not return

    Hello,
    I am running into a case where the call to Runtime.getRuntime.exec(command) does not return. The scenario is that the main thread spawns another thread which calls the Runtime.exec(). Since the call does not return, both threads seems to be hung. The jstack output from the main thread shows
    ----------------- t@2 -----------------
    0xfeedab45 ___lwp_cond_wait + 0x15
    0xfeb4030d void os::PlatformEvent::park() + 0xa9
    0xfebadd48 void ObjectMonitor::wait(long long,bool,Thread*) + 0x26c
    0xfe770287 void ObjectSynchronizer::wait(Handle,long long,Thread*) + 0xef
    0xfe76ffbb JVM_MonitorWait + 0x20f
    0xfb20a032 * java.lang.Object.wait(long) bci:0 (Interpreted frame)
    0xfb20308d * java.lang.Thread.join(long) bci:38 line:1143 (Interpreted frame)
    0xfb20308d * java.lang.Thread.join() bci:2 line:1196 (Interpreted frame)
    0xfb20308d * DataLoader.checkThreadGroup() bci:92 line:316 (Interpreted frame)
    0xfb202f27 * DataLoader.checkTables(int) bci:1 line:336 (Interpreted frame)
    0xfb202f69 * DataLoader.runLoad(int, java.lang.String, java.lang.String, java.lang.String, com.sabre.fltsked.apm.util.FSIOHelper)
    ... more below ....
    So it is waiting for the spawned thread on a join()
    And the jstack dump for the thread that called exec() is
    ----------------- t@70 -----------------
    0xfeed7409 __lwp_park + 0x19
    0xfeed1be7 cond_wait_queue + 0x5e
    0xfeed1f64 cond_wait_common + 0x1db
    0xfeed20d2 condwait + 0x7b
    0xfeed20fd cond_wait + 0x21
    0xfeed2136 pthread_cond_wait + 0x1b
    0x9741082a soft_delete_object_cleanup + 0x57
    0x97410906 soft_delete_object + 0x5b
    0x97410953 soft_delete_all_objects_in_session + 0x2e
    0x97407b7a soft_delete_session + 0xec
    0x97407860 soft_delete_all_sessions + 0x3c
    0x97402525 finalize_common + 0x66
    0x974026ae softtoken_fini + 0x34
    0x974355f9 _fini + 0x21
    0xfefdd49a remove_hdl + 0x766
    0xfefd8be9 dlclose_core + 0xb1
    0xfefd8c1d dlclose_intn + 0x21
    0xfefd8c96 dlclose_check + 0x2a
    0xfefd8d00 dlclose + 0x38
    0x97480aeb pkcs11_slottable_delete + 0xb1
    0x9747c691 finalize_common + 0xe2
    0x9747c6e0 pkcs11_fini + 0x3e
    0x9747c3bf pkcs11_fork_child + 0x73
    0xfee628b8 postforkchild_handler + 0x2f
    0xfeeca9ec fork + 0x12e
    0xfe338029 Java_java_lang_UNIXProcess_forkAndExec + 0x395
    0xfb20a032 * java.lang.UNIXProcess.forkAndExec(byte[], byte[], int, byte[], int, byte[], boolean, java.io.FileDescriptor, java.io.FileDescriptor, java.io.FileDescriptor) bci
    :0 (Interpreted frame)
    0xfb202f69 * java.lang.UNIXProcess.<init>(byte[], byte[], int, byte[], int, byte[], boolean) bci:62 line:53 (Interpreted frame)
    0xfb20308d * java.lang.ProcessImpl.start(java.lang.String[], java.util.Map, java.lang.String, boolean) bci:182 line:65 (Interpreted frame)
    0xfb202f27 * java.lang.ProcessBuilder.start() bci:112 line:452 (Interpreted frame)
    0xfb202f27 * java.lang.Runtime.exec(java.lang.String[], java.lang.String[], java.io.File) bci:16 line:593 (Interpreted frame)
    0xfb202f27 * java.lang.Runtime.exec(java.lang.String, java.lang.String[], java.io.File) bci:69 line:431 (Interpreted frame)
    0xfb202f27 * java.lang.Runtime.exec(java.lang.String) bci:4 line:328 (Interpreted frame)
    0xfb202f27 *SQLLoad(java.lang.StringBuffer) bci:181 line:51 (Interpreted frame)
    0xfb202e61 *FSLoadThread.run() bci:84 line:54 (Interpreted frame)
    The command I am trying to exec is "sqlldr" and I do have it in my PATH variable. Why is that the call to exec does not return? Any ideas?
    This is on jdk1.6.0_17
    Thanks,
    Bijoy.

    It has definitely forked, and this is the child process. It says so. If it was the parent process it would just show Java code related to launching processes. That does not involve PKCS11. After the fork there are two identical processes with the same stack: the child process of the fork goes on to replace itself with the target command via Unix exec(), which it doesn't look like it is succeeding at. The parent process doesn't do much at all, probably just housekeeping and then a Unix wait() for Process.waitFor() to hook into.

  • Illustrator CS6 does not store the last opened files

    I need Help,
    Illustrator CS6 does not store the last opened files.

    THat indicates a permissions issue on your preferences file and/ or your files are stored on some external or network device that doesn't use persistent file paths. Look into that.
    Mylenium

  • WebI does not return failed when scheduling a report which only holds parti

    WebI does not return failed when scheduling a report which only holds partial results.
    We have scheduled reports which take some time to run. When they are scheduled they sometimes show successful even though the report only holds partial results. The only indication is when you open the report as webi report you see the warning that it holds partial results.
    When running the report manually, it works file.
    The issue is not in the no of rows in the universe settings because we this unselected. The issue is that it times out.
    The reason that it times out is that a lot of resources are used for loading and processing data when the report is scheduled. When running it manually, it works because at this time the serverload is less. the time in the universe is set to 10 min.
    The version we have is BOXIR2-SP4.
    Ok. Issue identified.
    The question is - why is the report successful when it holds partial results? If this is normal behavior, noone can really trust the scheduled reports, especially when you save it to excel and send it by mail.
    Is there a solution for this except increasing the allowed query time which would not solve the issu but only allow more reports to complete?
    Edited by: Karlgren Michael on Sep 17, 2009 1:22 PM

    Hi ,
    Currently this problem exists in XI R2. This feature will be part of thenext Service Pack i.e XI R2 SP6.
    This CER will be delivered from IDC Webi and BIP Platform as part of Jupiter Sp6.
    Problem Statement:
         Scheduled WebI Reports which are partially refreshed are distributed to the destinations for Users to View and make decisions. These users arenu2019t usually aware that these reports have u201CPARTIAL RESULTSu201D
    Recomended Solution:
        Allow the Schedule Creator / Modifier to set a parameter to stop the distribution of the u201CPARTIALLY REFRESHEDu201D WebI report.
    Thanks
    Salini

  • My PC does not return to the source document I print from

    I had a setting control for
    this in XP but can't find the page I got it from.<o:p></o:p>
    <o:p> </o:p>
    In ANY application or browser
    this happens.  I print from a specific Excel workbook, by example, when I
    have a number of them open.  The system does not return to the workbook I
    printed from.  This is maddening and causes all kinds of issues.
     Searching the web for this now produces nothing and I know I can't be the
    only person who experiences this.<o:p></o:p>
    <o:p> </o:p>
    This is a Windows 7 platform
    in a networked business environment.  I'm running the Classic Menu add-in
    from Addintools because I can't stand the ribbon and have never liked it.
     In Windows 7, I'm running a couple of other add-ins that restore the XP
    use of the task bar properly so one can work efficiently.<o:p></o:p>
    <o:p> </o:p>
    None of the add-ins are what
    is causing this issue because I'd run the same Classic Menu add-in on the XP
    box and it had the same issue until I found the work-around that I can't
    remember now.<o:p></o:p>
    <o:p> </o:p>
    Has anyone else experienced
    this issue?<o:p></o:p>
    <o:p> </o:p>
    Jeff Lynch<o:p></o:p>

    Hi,
    "I print from a specific Excel workbook, by example, when I
    have a number of them open.  The system does not return to the workbook I
    printed from."
    If I'm not misunderstanding, do you mean that the workbook is automatically closed after you print from that workbook, right?
    As I know, if we use the default ribbon in Excel, no matter in Windows XP or Windows 7, the opened workbook should be stay opened after you print from that Excel workbook.
    So the question is that: what is the version of office? What is the Classic Menu add-in you're running now? Did you manually download and install it to your system? Could you please share a picture with us about the add-ins you're using?
    Yolanda Zhu
    TechNet Community Support

  • Very Very Urgent Issue: Restricted Key Figure does not return any data

    Hi all,
    Please help me solving this urgent issue.
    created customer exit variable on characterstics version and also
    other customer exit variable on Value type.
    I coded that in variable exit. Problem is when I include these in
    restrickted keyfigure My query does not return me any data.
    But if I remove from restrickted key firgure and put it as normal
    charaterstics I see the variable is getting populated.
    Also in RSRT the SQl generated when these are included in RKF is not
    correct.
    I debugged and know they are getting populated. As when included in RKF
    I can also see the values of customer exit variables from information
    tab.
    I also know that there is data in cube for those restrictions.
    I posted one OSS Notes regarding this urgent issue. But got no reply from SAP.
    FYI: We are using BEx 3.5 Browser SAP GUI 6.4 Patch 20 BW Patch 11
    Thanks
    SAP BW
    **Please do not post the same question twice: Very Urgent Issue: Restricted Key Figure does not return any data

    Hi,
    Everyone out there this is very urgent. If someone can help me solving this problem.
    We are using BEx 3.5 Browser SAP GUI 6.4 Patch 20 BW Patch 11.
    I posted one oss notes also regarding this issue. But got no reply from SAP.
    So, Please help me solving this issue.
    Thanks
    SAP BW

  • FM HRTRV_IF_GET_TRIP does not return USERDATA

    Hi, it's me, yet again...
    I'm using the FM "HRTRV_IF_GET_TRIP" in FITE_VC_GENERA_DATA in a post exit of comp-controller method "ON_SHOW" to get the structure/Table USER/PTK99 from the TE Cluster for binding to the context afterwards. At least that's the plan. The FM does not return me the data I expect in parameter USERDATA, although there is data in the TE Cluster and within the FM, I can see the global Table USER being filled whilst the macro RP-IMP-C1-TE. But this data is not further process neither is seems the strucutre USERDATA to be touched at any point of the FM. Am I calling the FM 'wrong' in any way? I'm close to making an implicit enhancement at the end and forcefully fill userdata from user....
    Too long, didn't read: USERDATA is not returned filled --> WHY?
    CALL FUNCTION 'HRTRV_IF_GET_TRIP'
      EXPORTING
        employeenumber             = wd_assist->GS_COMMON_RFC_INPUT-employee_number
        tripnumber                 = lv_tripno
    *   LANGUAGE                   = SY-LANGU
    *   CALCULATE_AMOUNTS          = 'X'
    *   GET_TRIP_FROM_MEMORY       = ' '
      IMPORTING
    *   FRAMEDATA                  =
    *   STATUS                     =
        USERDATA                   = ls_user " should contain cluster values, but it doesn't
      tables
    *   RECEIPTS                   =
    *   ADDINFO                    =
    *   GUESTS                     =
    *   TEXT                       =
    *   MILEAGE                    =
    *   STOPOVER                   =
    *   DEDUCTIONS                 =
    *   COSTDIST_TRIP              =
    *   COSTDIST_STOP              =
    *   COSTDIST_RECE              =
    *   COSTDIST_MILE              =
    *   AMOUNTS                    =
    *   ADVANCES                   =
        return                     = lt_bapiret " says method was executed successful
    In the insides of the FM:
    *  IF CALCULATE_AMOUNTS <> 'X'. "XJY
    * import the trip because it was NOT imported before
      READ TABLE T_PERIO INDEX 1.
      TE-KEY-PERNR = T_PERIO-PERNR.
      TE-KEY-REINR = T_PERIO-REINR.
      TE-KEY-PERIO = T_PERIO-PERIO.
      TE-KEY-PDVRS = T_PERIO-PDVRS. " Once this line is executed, the global table USER is fileld with the data I expect
      RP-IMP-C1-TE.
    *  ENDIF. "XJY
      if t_perio-abrec = '0' or
         t_perio-abrec = '1'.
        clear te-key-pdvrs.
        import beler from memory id te-key.
      endif.
    I hope somebody has ever used this one and can tell me what I'm doing wrong...
    Cheers, Lukas

    good to know. that you have already implemented similar thing. In our case if employee want to pick a manager he will only be given option from a custom table entries.
    They way i was thinking was that there will be a checkbox that will say "Override Approver"
    and when that will be checked text filed will be enabled with search help restricted to custom table entries.
    I have one question. When I am enhancing FITE_VC_REVIEW and adding field in that view, I m finding it hard to track it. Looks like adding to General data screen will be much easier.
    R u using ABAP memory to track field and use it at SMOD or you are using SAP memory ?
    I am just starting on this one and not expert at webdynpros.. will ping you if i need any more help
    and yes i just added following like in FM HRTRV_IF_GET_TRIP
    read TABLE user INTO userdata INDEX 1
    to get it to load userdata..

  • Search does not return my documents

    Hi Gurus,
    I have created few documents using CM SDK. I could able to see these documents using IFS browser.
    Now I wrote content search method to search document content.When I search for "cmsdk" string it returns 13 documents.But when I search for a string in the document, I created , for example a text like "struts" it does not return any result , though this document I can see in IFS browser.What could be the reason?.
    BTW I didn't create any FORMAT type while I am storing the document. Can any one point me to a document where I can find some instructions on "must and should things to do before search".
    I am using CM SDK 9.0.3.
    Thanks in advance.
    Giri.

    have you set the indexing on?

  • My Mini Ipad Does not return to the Home screen after I press the Home button

    My Mini Ipad Does not return to the Home screen after I press the Home button. I have also tried to turn it off and it is not responding.

    Check the following:
    1. Check credit card number
    2. Check security code
    3. Billing Address must be the same as credit card
    4. Check expiry date
    5. Make sure you have sufficient fund

  • Iphone 5  Does not return to the Home screen after you press the Home button, Iphone 5  Does not return to the Home screen after you press the Home button

    Does not return to the Home screen after you press the Home button

    The buttons do wear out, and when they do you'd need to get the phone serviced.  

  • IWEB previous does not return to previous page

    I am trying to get back to the last page with the Previous option in the Link setup. I do not know why it does not return to the previous page but some other pages.

    The following script is courtesy of Cyclosaurus.  Use it in an HTML snippet:
    <button type='button' target='_parent' onclick='javascript:history.back();' > Previous Page </button>
    OT

  • WB_RT_GET_JOB_METRICS does not return values

    DB v 10.2.0.2
    OWB repository/client v 10.2.0.3
    A DB function has a call to the Control Center transformation WB_RT_GET_JOB_METRICS to extract and preserve the metadata of number of records inserted/updated/deleted in a DB table.
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    1.
    The control center transformation WB_RT_GET_JOB_METRICS does not return any values when used under the Post-Mapping Process(mapped to the DB function describe above) in a Map.
    The input parameter ;Audit Id' to the Map is passed from a calling Process Flow. The following query is used to retrieve the Audit Id of the Map.,
    SELECT execution_audit_id
    INTO l_audit_id
    FROM ALL_RT_AUDIT_EXECUTIONS
    WHERE parent_execution_audit_id = P_AUDIT_ID;
    And the retrieve l_audit_id is passed to the WB_RT_GET_JOB_METRICS transformation to extract the number of records inserted/deleted/updated with the execution of the map.
    Gurus, please advice if the approach is appropriate to retrieve the number of records inserted/deleted/updated by the execution of the map. If not, any alternate method.
    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    2. The control center transformation WB_RT_GET_JOB_METRICS returns values when used in a standalone pl/sql block with the appropriate audit_id.
    Is this because the metadata for the Map execution is complete, whereas in the earlier attempt, the transformation is called within the map using the Post-Mapping process.
    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    3. Since the option 1 did not return any value, tried other option of calling/executing a transformation(call the the DB function mentioned earlier) after the Map activity is successful in a ProcessFlow. Here, the transformation does not seem to be executing, any tips of correcting this issue.
    Request the forum for some helpful tips to resolve the problem. TiA (Thanks in Advance) for the response.
    Message was edited by:
    user599655

    In a process flow, passed the pseudo variable to a transformation to run the WB_RT_GET_JOB_METRICS after the map execution. I am not sure if this is the best solution, but it worked for me.
    Still trying to figure how to use the pre-defined transformation when working on expression.
    Thanks.

  • When using rabbitmq-jms for vFabric RabbitMQ javax.jms.Message.getJMSDestination does not return the actual destination when it is received from a consumer listening on a Topic with a wild card

    When using rabbitmq-jms for vFabric RabbitMQ javax.jms.Message.getJMSDestination does not return the actual destination when it is received from a consumer listening on a Topic with a wild card. I have tested with both 1.0.3 and 1.0.5 clients with RabbitMQ 3.1.5.
    I was wondering if the community was aware of this problem and if there are any workarounds? If not what is the proper channel to file a bug report. An example code snippet is below. The test fails because the TextMessageMatcher expects the destination passed in on construction (second parameter) to equal the desination on the message received (aquired from getJMSDestination).
            Mockery context = new Mockery();
            final MessageListener messageListener = context.mock(MessageListener.class);
            final Latch latch = new LatchImpl();
            final String prefix = "test" + System.currentTimeMillis();
            context.checking(new Expectations() {
                    oneOf(messageListener).onMessage(with(new TextMessageMatcher("MSG1", prefix + ".1234")));
                    will(new CustomAction("release latch") {
                        @Override
                        public Object invoke(Invocation invocation) throws Throwable {
                            latch.unlatch();
                            return null;
            final Connection connection = createConnection(null, null);
            Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
            connection.start();
            Topic wildcardTopic = (Topic) getInitialContext().lookup(prefix + "." + "#");
            Topic destination = (Topic) getInitialContext().lookup(prefix + ".1234");
            final MessageConsumer consumer = session.createConsumer(wildcardTopic);
            consumer.setMessageListener(messageListener);
            MessageProducer producer = session.createProducer(null);
            producer.send(destination, session.createTextMessage("MSG1"));
            latch.await(5000);
            connection.close();
            Thread.sleep(5);
            context.assertIsSatisfied();

    Check where your MDB sends the [response] messages to.

  • OCIStmtExecute does not return immediately when client is busy.

    Hi.
    I'm testing a very busy multi-threaded client server that consistently generates
    a large number of simple queries through oci. The problem is that, when the
    server(client) is busy, OCIStmtExecute does not return immediately in
    non-blocking mode.
    Of course I have set non-blocking mode and OCIStmtExecute does return
    OCI_STILL_EXECUTING immediately when the server is not busy. But
    when log rotation occurs which concatenates a large text file (~500MB)
    onto an even larger text file (up to several giga bytes), or when I simply copies
    or concatenates large text files manually, OCIStmtExecute returns very slowly.
    (roughly about after 100~200ms)
    However, while log rotation takes place, everything else including other oci
    calls that come before OCIStmtExecute (prepare, define) return fast. So
    for me it really seems that only OCIStmtExecute becomes extremely slower
    when local server (especially the disk) is busy.
    Is there any way to let OCIStmtExecute immediately return all the time?
    Thanks in advance.

    Yes, I knew that OCIStmtExecute would be the only function that causes such
    delay and that was why I traced that call. And so far, I checked several times
    what happens at the exact moment on the server but everything was ok.
    Actually OCIStmtExecute becomes slower exactly when crontab-ed log rotate
    occurs so I think this delay must be a client-side problem for now.
    This server is quite busy and has to respond fast, so it is important to
    guarantee fast response time while a small number of timeout losses are tolerable.
    But as OCIStmtExecutes' first OCI_STILL_EXECUTING return takes hundreds of
    ms it has become more like a blocking call and currently I cannot find any way to do what I want.
    So now everytime such thing happens, the thread waits
    quite long, after the first OCI_STILL_EXECUTING return
    the time difference exceeds timeout limit, and the thread
    calls OCIBreak() and OCIReset() and returns.

  • Server does not return metadata, check the query.

    Hi,
    I need your help in using report designer of Bex, The issue is when we try to open a query in the report designer we get a Error Server does not return metadata, check the query.
    Thanks in Advance
    Kind Regards
    Phutane

    Hi,
    All the yellow and red lights will have an effect on query performance or execution.  Read up on them as there are too many to explain via this forum.
    There is a document on SDN on query performance.  Some useful links:
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/9f4a452b-0301-0010-8ca6-ef25a095834a]
    [http://help.sap.com/saphelp_nw70/helpdata/en/41/b987eb1443534ba78a793f4beed9d5/frameset.htm]
    [http://help.sap.com/saphelp_nw70/helpdata/en/d9/31363dc992752de10000000a114084/frameset.htm]
    [http://help.sap.com/saphelp_nw04/helpdata/en/2e/caceae8dd08e48a63c2da60c8ffa5e/frameset.htm]
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e0501cb9-d51c-2a10-239c-c141a22c45a6]
    Cheers...

Maybe you are looking for

  • HR - Supress Error messages at end of PNP Logical dB ABAP

    It appears from the code for logical dB PNP that you can turn off the error messages that automatically print at the end of the program, but I don't see how to do it.  Here's the SAP code in include DBPNPI01: FORM end-processing.   CHECK sw_supress_w

  • 2009 13 MBP can't find the HDD.

    I had gotten the gray folder with a ? mark in the middle recently.  Because the system is a little older and from what I have read here I decided to upgrade the HDD.  I installed the new disk, and booted up.  The system used the online recovery to re

  • Tool to make easy code for making pictures in java

    e.g. g.drawLine(10,10,50,100) Is there a simple tool where I can draw a line on a screen and that that tool gives me then the right coordinates to put it in the java code? Of course this simple line is just an example. I want to use this to create ad

  • How do I force a reinstall of ARD on Mavericks

    I had a developer version of ARD and deleted it to reinstall the Mavericks version from the App Store. Now The app Store still thinks it is installed so I can't reinstall it. Is there anyway to force a reinstall of ARD.

  • Swf with external .as files not working in Captivate

    Hello, I am using Flash Professional CS5.5 & Captivate 5.5 (purchased with eLearning suite). When I insert swf animations into Captivate that have external .as files they do not work. Tried both insert animation & insert animation slide - same result