Execution flow doesn't wait for return values

I have created JNI wrappers for existing dlls. However I'm getting weird behavior. My Java function calls a c function which communicates with an old mainframe. If I retrieve one row at a time its fine but if I do a loop the virtual machine crashes. Sometimes, if I add an empty loop for (30000 iterations) then its fine. Its like java is already trying to retrieve the next row while the first row is still being printed on my screen. I've tried adding synchronized in case the dlls where multi-threaded but it has not made a difference. Is there any way to control the execution flow so that it can't go to the next line until the values are truly returned from the c dll.
thanks
MA

There are many function being called on the native side. Since I didn't want to modify the native side
(because the old dlls are used by another application), I added my own dll as an intermediary between the old c dlls and the java side.
To fix the problem I am having, I've heard of another project where the native side would write the returned values to a file and only once the file is written can the Java side continue. Is this the only way to control the execution flow?
Right now I have about 5 empty loops which run to 100000 and things work most of the time. But I would prefer to find a way to say wait until the values are returned correctly.
Essentially, what I'm doing is
for (int i=1;i<10; i++){
   test.init(Integer.toString(i),Integer.toString(i),"english desc"+  Integer.toString(i),"french desc"+ Integer.toString(i));
   test.execute(test.ActionAdd);
}This is supposed to add one row with four fields. I'm just putting junk for the test. If I call the two main lines
test.init(Integer.toString(i),Integer.toString(i),"english desc"+  Integer.toString(i),"french desc"+ Integer.toString(i));
test.execute(test.ActionAdd);just once it works fine but if I loop them then it crashes after a few loops. If I put a loop as shown below then it works fine. This is part of the code when I'm adding. Is it being looped 10 times from the code above.
jsession.scanTable(table,errorlist);
            rtc = table.getRecordCount(errorlist);
            if (rtc > 0)
            publish(rtc+" records found.");
                for(int i = 1; i <= rtc; ++i)
                    for (int j = 0; j < ElementName.size();j++)
                        publish((String)ElementName.get(j)+ ": " + table.getFieldByName((String)ElementName.get(j),i,errorlist));
                        for (int k = 0; k<100000;k++);
            else
                publish("No records found.");
            }In the code, when the rows are added, I print them out just to make sure they were added correctly. This is where I got the idea that the Java code was not in synch with the native side because it would crash while writting out a line but it didn't happen every time at the same place.
This is the function getFieldByName
public String getFieldByName (String p_FieldName, int p_LineNum, ErrorList p_Errors)
          String retval = "";
          int ret;
          try
               p_FieldName = prepareFieldName(p_FieldName);
               retval = new String();
               ret    = 0;
               if (this.ptrTableView == NOT_SET)
                    p_Errors.addMessage(p_Errors.SEV_SYSTEM_ERROR(), "Table View Pointer not set");
                    throw (new Exception());
               // allocating string buffer for value returned
               StringBuffer m_FieldValue = new StringBuffer();
               // determining length of value
               int m_length[] = {0};
               ret = gti.GetFieldLen(this.ptrTableView, p_FieldName, m_length, eb.getErrorBlockPtr());
               if (m_length[0] == 0) m_length[0] = 100;
               m_FieldValue = new StringBuffer(m_length[0]);
               // get line field          
               ret = gti.GetLineField(this.ptrTableView, p_FieldName, p_LineNum, m_FieldValue, eb.getErrorBlockPtr());           
               if (ret != 0)
                      p_Errors.addMessage(p_Errors.SEV_ERROR(), "Error retrieving field value ("+p_FieldName+")");
               else
                      retval = m_FieldValue.toString();
          catch (Throwable t)
               p_Errors.addMessage(p_Errors.SEV_ERROR(), "Error retrieving field value ("+p_FieldName+")");
          return retval;
    }The main functions are
GetFieldLen
GetLineField
They go to the native side through my dll which wraps the old dlls.
Here are is one of the main functions in my dll. I also have the source for the functions they are calling but they are calling other functions which are calling other functions. There is a lot of code . Yes, they use arrays.
JNIEXPORT jint JNICALL Java_advantagewrapperspk_GtiNative_GtiGetLineField
  (JNIEnv *env, jclass cls, jint p_tableViewPtr, jstring VIEWFIELDNAME, jint VIEWFIELDNUM, jobject VIEWFIELDVALUE, jint iErrBlockPtr)
       //printf("\n\nGtiGetLineField in C:\n");
       jint iResult = 0;
       char *temp1 = (*env)->GetStringUTFChars(env,VIEWFIELDNAME,0);
       char *temp2 = (*env)->GetStringUTFChars(env,VIEWFIELDVALUE,0);
     iResult = GtiGetLineField(p_tableViewPtr,temp1,VIEWFIELDNUM,temp2,iErrBlockPtr);
       //printf("VIEWFIELDNUM %d ",VIEWFIELDNUM);
       //printf("\ntemp1 %s ",temp1);
       //printf("\ntemp2 %s ",temp2);
     (*env)->ReleaseStringUTFChars(env,VIEWFIELDNAME,temp1);
     if (temp2 == 0)      return iResult;
    if (temp2 != NULL)
            cls = (*env)->GetObjectClass(env,VIEWFIELDVALUE);
            jmethodID mid = (*env)->GetMethodID (env,cls,"append","(Ljava/lang/String;)Ljava/lang/StringBuffer;");
             if (mid == 0) return iResult;
             jstring sfinal = (*env)->NewStringUTF (env, temp2);
            (*env)->CallObjectMethod(env,VIEWFIELDVALUE,mid,sfinal);
          if (VIEWFIELDVALUE != NULL) (*env)->ReleaseStringUTFChars(env,VIEWFIELDVALUE,temp2);
     //(*env)->ReleaseStringUTFChars(env,VIEWFIELDVALUE,temp2);
     return iResult;
  }This calls
* Function Name : GtiGetLineField()
* Description   : Retrieves the value of a line field in a table view
* Parameters    : pTableViewPtr pTableView--the table view from which to
*                                           retrieve the value of a line
*                                           field
*                 VIEWFIELDNAME szFieldName--the name of the line field
*                                            whose value is returned
*                 VIEWLINENUM iLineNum--number of line from which to retrieve
*                                       field value.  Lines are numbered
*                                       beginning with 1.
*                 VIEWFIELDVALUE szFieldValue--returns the value of the
*                                              line field
*                 ErrBlockPtr sourceeb--error context info from calling
*                                       function
* Return values : int--returns RCT_RETURNOK, RCT_WARNCORECONNECT, or
*                      RCT_FAILCORECONNECT
* Modifications : REH - 05/25/93
int GtiGetLineField ( TableViewPtr pTableView,
                      VIEWFIELDNAME szFieldName,
                      VIEWLINENUM iLineNum,
                      VIEWFIELDVALUE szFieldValue,
                      ErrBlockPtr sourceeb )
   int iRc ;      /* return code */
   ELOG_INIT( sourceeb,
              "GtiGetLineField",
              "retrieving the value of a line field in a table view" ) ;
   /* in Gti, we start numbering lines from 1, because that is the way a user
      sees them on the screen.  In Ldm, following C conventions, we start
      numbering lines at 0.  So in LdmSetField, we subtract 1 from iLineNum */
   iRc = LdmGetField( pTableView->pTran,
                      szFieldName,
                      szFieldValue,
                      iLineNum - 1,
                      0,                  /* map occurrence = 1 */
                      ELOG_ERRBLOCK ) ;
   /* in case Ldm returned a warning, indicate so to the calling function */
   iRc = ( iRc == LDM_RETURNOK ) ? RCT_RETURNOK : RCT_WARNCORECONNECT ;
   return( iRc ) ;
   /* if exception was raised, it was due to COREConnect */
   ELOG_END( RCT_FAILCORECONNECT ) ;
}which calls
/****************************** API Header *********************************\
* API Name: LdmGetField
* This function copies the string value of a specified FIELDNAME into a
* buffer specified by FIELDVALUE.  The string is NULL terminated.
* The first OCCUR determines which occurrence of the field in the map.
* The second OCCUR determines which occurence of the map in the transaction
* area.  Remember that occurrences are numbered like C arrays: a transaction
* with ten occurrences of a field will have fields numbered zero through
* nine.
* It is assumed that FIELDVALUE has enough space to accommodate the field's
* value.
int LdmGetField( HTRAN       htran,
                 FIELDNAME   fieldname,
                 FIELDVALUE  fieldvalue,
                 FIELDOCCUR  fieldoccur,
                 MAPOCCUR    mapoccur,
                 ErrBlockPtr seb )
   ELOG_INIT ( seb, "LdmGetField", "getting transaction field value" ) ;
   if ( htran->Occurrence <= mapoccur ) {
      ElogFail1( LDM_FAILOCCNOTFOUND, htran->TranName ) ;
   }  /* END if. */
   /* Since 'blank' values for field or map occurrences are zero, there
      is no need to set a default. */
   LdmsGetField( htran->Map->CCMap,
                 htran->TranData,
                 fieldname,
                 fieldvalue,
                 fieldoccur,
                 mapoccur,
                 ELOG_ERRBLOCK ) ;
   return( LDM_RETURNOK ) ;
   ELOG_END ( ELOG_ERRBLOCK->Rc ) ;
}  /* END LdmGetField. */which calls
/****************************** API Header *********************************\
* API Name: LdmsGetField
* Put the value of FIELDNAME into FIELDVALUE.  The field must be an element
* of the specified map.  The new value will be set in the specified data
* buffer.  The occurrences refer to the occurrence of the field in the map
* and the occurrence of the map in the data buffer.
int LdmsGetField ( CCMapPtr    rcmap,
                   char        *dataarea,
                   FIELDNAME   fieldname,
                   FIELDVALUE  fieldvalue,
                   FIELDOCCUR  fieldoccur,
                   MAPOCCUR    mapoccur,
                   ErrBlockPtr seb )
   ElementPtr element ;
   char       *fieldoffset ;
   ELOG_INIT ( seb, "LdmsGetField", "getting a field of a map" ) ;
   /* Search the transaction definition area (map) for matching
      FIELDNAME. If found, copy FIELDVALUE to defined offset in
      transaction buffer. */
   element = LdmsFindField( rcmap, fieldname, fieldoccur, &localeb ) ;
   /* Copy the value from the transaction data area into FIELDVALUE. */
   fieldoffset = dataarea +
                 ( ( rcmap->BufferLength * mapoccur ) + element->Offset ) ;
   strncpy( fieldvalue, fieldoffset, element->Length ) ;
   fieldvalue[ element->Length ] = '\0' ;
   return( LDM_RETURNOK ) ;
   ELOG_END ( ELOG_ERRBLOCK->Rc ) ;
}  /* END LdmsGetField. */and on it goes
I gather from your question about arrays that they might be the source of the problem. Could it be that the pointer to the array is returned while the array is not completed? Any information would help. Thanks.

Similar Messages

  • Delete Record Behavior doesn't wait for Submit button

    I have master / detail page set.  From the detail set there are links to delete or update a record.  When I click the link to delete the record, it goes to the   confirmation page with the correct record.  Now, when I add the delete record server behavior and a submit button, this is what happens.  As soon as I click the link to go to the delete confirm page, the record deletes and the page redirects to the page I put in the server behavior.  It doesn't show the confirm page and doesn't wait for me to hit the confirm button.  The page runs and successfully deletes the page from the DB.
    How do I get it to wait until I hit the submit button?

    You need to surround your delete query with an "If" statement that checks for a confirmation variable of some sort, then when the user clicks the confirmation link you can pass the necessary variable and the ID of the record the delete query is expecting.
    As an alternative you could use a JS alert fuction to ask the user if they are sure they want to delete the record and then allwo the delet to run after confirmation. To do this you could use code like this...
    <input type="submit" name="DELETE" value="DELETE"
       onclick="return confirm('Are you SURE you want to DELETE this record?')">
    Lawrence   *Adobe Community Expert*
    www.Cartweaver.com
    Complete Shopping Cart Application for
    Dreamweaver, available in ASP, PHP and CF
    www.twitter.com/LawrenceCramer

  • T-SQL and CLR types for return value do not match

    Hi I am trying to create a CLR function to call a webservice, the CLR function return data type is double, whether I try
    to create this as a table valued funcion or a scalar to return a distance travelled value I am receiving the error below. I've tried changing data types around in the CLR side and the SQL side but keep receiving the same error message, any help would be appreciated,
    Thank you,
    [Microsoft.SqlServer.Server.SqlFunction(Name = "DistanceCalc")]
    public static Double DistanceCalc(Double SrcLat, Double SrcLong,
    Double DestLat, Double DestLong)
    MileageWS ws = new MileageWS();
    ws.Url = "http://test.isp.ca/Distance.asmx";
    int intUom = 0; // 0 = Mile, 1 = KM
    RouteType RouteMethod = RouteType.Practical;
    Requester RequestedFrom = Requester.LinkRoute;
    Double distance;
    distance = ws.GetDistanceInfoForLonLat(SrcLat, SrcLong, DestLat, DestLong, intUom, RouteMethod, RequestedFrom);
    return distance;
    CREATE FUNCTION DistanceCalc
    @SrcLat as float, @SrcLong as float,
    @DestLat as float, @DestLong as float
    RETURNS TABLE (Distance float)
    External NAME CLRfunctions.RIFunctions.DistanceCalc
    GO
    Error received when try to Create function ...
    1, Level 16, State 2, Procedure pcMiler, Line 6
    CREATE FUNCTION for "pcMiler" failed because T-SQL and CLR types for return value do not match.

    You defined at table-valued CLR function, but I think you meant to define a scalar CLR function. That might be the cause of the error.
    RETURNS TABLE (Distance float)
    should be
    RETURNS (Distance float)

  • I'm looking for return value if trigger level is reached,in LABVIEW .NO data acquisition.

    I won't like to acquire data with the analog input , only a return value if the trigger level is reached, dearest a Bool expression to control another function, only to activate or deactivate this function. I use the PCI MIO 16E1 and Labview 6 and i hope there is someone who can help ; -)

    The DAQ Occurence will probably be the best option for you. It can be set to generate an occurence (interrupt) at a particular level. You won't get a BOOL output. Instead, you have another node (Wait on Occurence) that doesn't allow execution to continue until the occurence is generated.
    Otherwise, you may have to do a point-point comparison.

  • Is there any way to wait for a value without using JDialog or JOptionPane?

    I am implementing a dictionary program by detecting word in a JTextPane and asking a user to choose one of available meanings from JOptionPane or JDialog. The program runs under a while-loop until all dictionary words are detected or a user clicks cancel.
    However, I don't want to use JDialog or JOptionPane because it is sometimes annoying to have a popup window on every detected dictionary word.
    So, I use JList with Buttons on the same Frame as the JTextPane. However, now, the program does not stop when it detects a dictionary word. It just uses a default value of the JList for translating word to meaning.
    Is there any way I can simulate the JDialog or JOptionPane without using it?
    I mean I'd like to stopp the program temporary, wait for an answer from other components, and then continue to detect the next dictionary word.
    Thank you.

    I'm probably reading this all wrong, but instead of the while loop,
    the method just looked for a dictionary word from a particular caretPosition,
    so, to start, it would be findWord(0)
    when found, add whatever to wherever, note the caretPostion at the end of the 'found' word, and method returns.
    when the user selects whatever button, the button's actionListener also calls the method again, using the noted caretPosition
    findWord(42);
    so, it starts searching from 42 (instead of the start)
    basically it is event driven
    findWord sets the button/s
    click a button starts findWord

  • I misordered Photoshop Elements for Windows but have a Mac. I have a refund order number with refund waiting for return. How do i return a download?

    How do I return a download? I've been waiting for instructions for over a week now. I mistakenly ordered  for Windows but I'm using a Mac.

    You don't have to return it, just go here
    Order product | Platform, language swap

  • System hangs mounting encrypted lvm, doesn't wait for password

    I have a system with two hard drives, each that has a separate encrypted lvm. The drive with my / parition mounts fine, using the grub command line cryptdevice paramater.
    But the second encrypted partition on the second hard drive, defined in crypttab, causes the system to hang during boot. I get a message: "a start job is running for cryptography setup" and a little moving asterick while the system waits. At the same time there is a second similar message with moving asterick: "a start job is running for" and the name of the lvm device to be started. And if I define all the volumes on the lvm to be mounted in fstab, I get yet more "a start job is running" messages and hangs for them, all simultaneously.
    It seems like the system is not stopping and waiting for the password, before trying to start the lvm and then hanging. I've found that I actually can type in the password while the system is stuck like this (though the screen doesn't really register that I'm typing a password) and then the system will continue and start the lvm and mount volumes properly as defined in fstab.
    I don't really know much about how all this stuff works, but gather from reading around that perhaps systemd is not waiting for the password, before tying to automatically start the lvm? And tha'ts causing the hang. (I have LMDE installed with a separate /boot parition on the same number 1 drive and it boots as expected, I'm assuming this is because it's not using systemd.)
    The only post that I could find that remotely seemed similar to my problem is this: https://bbs.archlinux.org/viewtopic.php?id=153811
    But I don't really follow what's being said in that thread or the solution, regard the .service file. Where is is? What would I edit in it? Is that what I want to do?
    Thanks to anyone for any help on this.

    Well I just figured out that I put the wrong UUID in /etc/fstab. /dev/sdb1 (the disk being unlocked) != /dev/mapper/crypt2 (the unlocked partition). Now everything works as it should.
    Last edited by houron102 (2012-09-14 01:19:47)

  • Text item mapped against more than one LOVs for returning value

    hi to all,
    is it possible to have two LOVs (LOV1 & LOV2) that return value to a same text item (:LOV_VAL )on a form.
    i.e.
    on selecting LOV1 row, value is returned to :LOV_VAL item.
    On selecting LOV2 row, value is returned to :LOV_VAL item.
    on the basis of valued retured to :LOV_VAL the data block is queried.
    If yes how , if now please provide me alternative way.
    Thanks in advance.
    plz do it fast.

    Hello,
    Why don't you try ?
    You can define a return item for each column of each LOV.
    If you want, you could have one hundred LOVs that return the same column in the same item.
    Francois

  • P965 platinum SATA issues (doesn't wait for disk spinup!!!!!!!!)

    Hi
    I've recently migrated from a 2-HD setup (seagate & hitachi) that worked just fine to a single hd setup (western digital WD3200AAKS).
    Now when I turn on the pc, the BIOS goes too fast and doesn't wait enough time for the disk to spin up (since the WD disk has a considerably longer spinup time), and for the first boot, there's no HD detected. It simply hangs.
    In fact, i can see the line "Detecting SATA PORT 2..." for a while, but then it writes "not detected" and goes ahead.
    Then if I ctrl-alt-del, it works just fine.
    How can I solve this? Possibly without disabling fast booting!...
    thanks in advance
    bye bye

    Quote from: jsmartin22 on 28-June-07, 13:41:50
    This is note the solution wanted to hear, but it is reasonable:  Why not dump the WD and get a new drive?   For ~$100 you can get a new 500 GB SATA drive and for the price of a little more than $100, you will have your system integrity; and you can probably sell the WD drive or use it with another MB/computer.    Something to think about maybe?  Good luck. 
    I've just changed it! It's a 320gb drive but it has all the bells&whistles of its 500gb big brothers! Perpendicular recording, ncq, and etc...
    In fact, apart from that spin-up issue, is blazing fast, even faster than Seagates!

  • FM JOB_CLOSE doesn't wait for pred job even when pred_jobname/jobcount set

    Dear experts,
    I need to call in sequential order two batch jobs when there is a special condition. It's not always the case, which means when there is no successor task, then the job should be executed immediately. But when there is another waiting in the queue, then
    I set the parameters pred_jobcount/pred_jobname so that the next job is executed when the previous is finished.
    I tried with the combination of several parameters, read lots of help and checked example programs, but the problem I've got: either both jobs are launched at the same time (so it does';t really wait for the predecessor to be completed sucessfully even if predjob_checkstat is set to X), or the second job is never launched at all! Here is the call of JOB_CLOSE:
    AS_PRED contains the correct information of the predecessor job (I verified against SM37 and no problem there). For the first job to be launched, I have no issue at all. However the successor is not launched at all!
    (Just to play around and to test some other parameter combination, I called the FM with strtimmed always set to X but then both jobs are launched at the same time, which is not convenient for me!).
    IF as_pred IS INITIAL.
        lv_strt_immed = 'X'.
      ELSE.
        lv_strt_immed = space..
        lv_checkstat = 'X'.
      ENDIF.
    * Plan job with direct start after predecessor job (if available)
      CALL FUNCTION 'JOB_CLOSE'
        EXPORTING
          jobcount             = me->job_count
          jobname              = me->job_name
          pred_jobcount        = as_pred-predjobcnt
          pred_jobname         = as_pred-predjob
          predjob_checkstat    = lv_checkstat
          strtimmed            = lv_strt_immed
        IMPORTING
          job_was_released     = lp_job_released
        EXCEPTIONS
          cant_start_immediate = 1
          invalid_startdate    = 2
          jobname_missing      = 3
          job_close_failed     = 4
          job_nosteps          = 5
          job_notex            = 6
          lock_failed          = 7
          invalid_target       = 8
          OTHERS               = 9.
    Do you have any hint what might be wrong with the function call above?
    Many thanks for you help, best regards
    Ebru

    BP_JOB_CREATE can be used to create dependent jobs. The below sample program creates a chain of jobs. Prerequisite: the report program YTEST should exist.
    ++++++++++++++++++++++
    REPORT  yjob_chain.
    DATA cntr(3) TYPE n.
    PARAMETERS:
      job_str(10) TYPE c DEFAULT 'ABC', "default jobname template
      p_njobs TYPE i. "number of nodes in chain
    DATA jobname LIKE tbtcjob-jobname.
    DATA jobcount LIKE tbtcjob-jobcount.
    DATA pred_jobname LIKE tbtcjob-jobname.
    DATA pred_jobcount LIKE tbtcjob-jobcount.
    DATA flg_1stjob TYPE c.
    START-OF-SELECTION.
      CLEAR flg_1stjob.
      DO p_njobs TIMES.
        PERFORM create_job.
      ENDDO.
    *&      Form  create_job
    *       text
    FORM create_job.
      DATA global_job01 TYPE tbtcjob.
      DATA global_job02 TYPE tbtcjob.
      DATA steplist TYPE STANDARD TABLE OF tbtcstep.
      DATA stepline TYPE tbtcstep.
      stepline-program = 'YTEST'.
      stepline-typ = 'A'.
      stepline-authcknam = sy-uname.
      APPEND stepline TO steplist.
      cntr = cntr + 1.
      CONCATENATE job_str '-' cntr INTO jobname.
      global_job01-jobname = jobname.
      global_job01-jobclass = 'C'.
      IF flg_1stjob IS NOT INITIAL.
        global_job01-eventid = 'SAP_END_OF_JOB'.
        global_job01-eventparm = pred_jobname.
        global_job01-eventcount = pred_jobcount.
      ELSE.
        global_job01-reldate = sy-datum.
        global_job01-reltime = sy-timlo.
        global_job01-strtdate = sy-datum + 1.
        global_job01-strttime = '010000'.
      ENDIF.
      CALL FUNCTION 'BP_JOB_CREATE'
        EXPORTING
          job_cr_dialog       = 'N'
          job_cr_head_inp     = global_job01
        IMPORTING
          job_cr_head_out     = global_job02
        TABLES
          job_cr_steplist     = steplist
        EXCEPTIONS
          cant_create_job     = 1
          invalid_dialog_type = 2
          invalid_job_data    = 3
          job_create_canceled = 4
          OTHERS              = 5.
      IF sy-subrc = 0.
        pred_jobname = jobname.
        pred_jobcount = global_job02-jobcount.
        flg_1stjob = 'X'.
        WRITE:/ 'Created Job- ', 'Name: ', global_job02-jobname, 'Number: ', global_job02-jobcount.
      ELSE.
        WRITE:/ 'Error creating job'.
      ENDIF.
    ENDFORM.                    "create_job

  • Automator doesn't wait for app to finish launching.

    During "watch me do" actions that lauch an app Automator does not wait for the app to launch. This seems like a bug since Automator does infact know it is launching an app, this shouldn't be something that should require a sleep every time.

    Did you try one these actions?

  • Lion doesn't wait for DHCPACK on wifi after resume?

    I've been noticing this occasionally on my MBA, and just got asked about it by someone else who's also seeing it:  when resuming Lion with a WiFi connection, sometimes it will bring the network up for a couple seconds, then drop for a bit with the WiFi icon showing it requesting an IP address, then come back.  HardwareGrowler shows it initially coming up with the same address it had been using when suspended, then eventually getting a new address, which leads me to believe that Lion is speculatively bringing up the interface on the old address without waiting for a DHCPACK; if it gets DHCPNAK instead, it then has to take the interface back down and go through the usual DHCPREQUEST/DHCPOFFER dialog with the DHCP server.
    Is there a way to make it wait until it has received a reliable address (either DHCPACK to the old lease or the full DHCP negotiation) before bringing the interface up, rather than having it "stutter" when the original lease isn't ACKed?
    FWIW I have seen this with all versions of Lion.  I don't recall seeing it with older versions.

    NOTE:  I did exactly what you want to do all the time, and it works very well.  BUT I have set things up so that this works.
    Do both WiFi and Ethernet get the same IP address from your router?  If not, then your existing file sharing setup is already established over the IP address assocaited with WiFi and that is where your transfer is going to stay.
    Again, if you are currently getting different IP addresses, then I see 2 approaches
    a) If your router's DHCP server allows associating an IP address with either a system's MAC address (Media Access Control; looks like nn:nn:nn:nn:nn:nn), or by associating an IP address with the "DHCP Client ID" (See System Preferences -> Network -> Advanced -> TCP/IP -> DHCP -> DHCP Client ID), then configure your router so that both the WiFi and Ethernet are connections to the router are assigned the same IP address.
    b) another approach is to change each Mac's network setup so that they used Fixed IP addresses when at home (you can create a new network location for home use).  You would configure the WiFi and Ethernet interfaces so they have the same IP address (each Mac gets its own unique IP address, and if possible the address you assign should be outside the router's DHCP address range, so that the router does not assign a duplicate address).
    If both interfaces have the same IP address, then when you plug in the Ethernet cable (assuming the interface order has Ethernet as higher than WiFi - which is the default)

  • Search row and column for return value

    Dear Sir/Madam,
                               I have a problem for searching spreadsheet and hope you can help me out a bit.  Im pretty new to Labview and Im currently using Labview 8.0.  My task is to search the spreadsheet I have attached in row and column-wise, then return the corresponding value out.  I had an attempt in doing this as you can see from the vi that i have attached.  I try inputting the 'read from measurement file' into an array and using delete, index and search array I will be able to find the index value for the relevant row and column that i searched for by inputting them into an index array with the orginal array from the 'read from measurement file'.
                              So ultimately, when i enter a row value of 0.5 and a column value of 0.3, my output will be 1.688.
                              I can't see any mistakes in my logic but I getting really strange results, like I can read my data has been entered into an array but when i try deleting the first column and put it into another array, the orginal array with nothing deleted is outputted hence making my search to give out -1 value. So could you take a look please and give me any suggestion that can solve my problem or enhance the code a bit.  Thank you for your time.
    Best Regards,
    Coato
    P.s for some reason i can't attached the .lvm file of my data hence i have attached the excel version but i think you need to convert it back to .lvm for the 'read from measurement file' function to work.
    Attachments:
    Backswing compensation.csv ‏10 KB
    Backswing comnpensation2.vi ‏109 KB

    Your VI makes absolutely no sense to me, but maybe I don't understand what you are trying to do.
    You seem to have dynamic data with 6 signals and 48 points/channel. Now you reshape this into an array of dynamic data with 4x13 elements from which you slice out one row or column, resp. "delete from array" is NOT the correct tool to do this, use "Index array" with one index unwired to get a row or column as 1D array.
    So you end up with two 1D arrays of dynamic data that you search for DBL. It is difficult to understand how you want to search for an array element that corresponds to a scalar DBL value of 0.1. Your array elements are NOT DBLs but dynamic data, each containing many signals!
    There are two elements on all your data that are "3", the rest are zero. You will never find anything that is 0.1.
    Maybe you can convert your original dynamic data to a 2D array with "rows are signals" using "convert from dynamic data", then operate on the 2D array.
    Coato wrote:
                              So ultimately, when i enter a row value of 0.5 and a column value of 0.3, my output will be 1.688.
    Sorry, Please explain.
    Please make a VI containing a simple 2D aray as diagram constant that contains e.g. 5x5 typical values. Let us know what kind of result you expect from your algorithm..
    LabVIEW Champion . Do more with less code and in less time .

  • Dynamic implementation download for return values from EJB

    I try the following exemplary scenario regarding dynamic implementation download. Let's say there is a statless EJB deployed (e.g. OrderHandler) with a method getSomeOrder() returning Order object; where Order is actually an interface extending java.io.Serializable. For Order there is implementation class OrderImpl. Within the getSomeOrder() the EJB creates a new OrderImpl, populates it and returns as interface. The client looks up OrderHandler and calls getSomeOrder() method. Then, on Order a dummy: String getName() method is called.
    Now, the problem is various behavior with implementation dynamic download. I receive different behavior from 2 clients (1st being launched from within LAN with the server, 2nd from outside server's LAN). When I put OrderImpl in clients' classpaths, obviously they both work the same. When I leave only Order interface (!!the very goal of the test - dynamic impl. download!!), only the 1st client still works. I measured times in milis, and it looks that the OrderImpl is really downloaded, as the first getSomeOrder() call lasts around 10 times as long as further calls.
    The 2nd client hangs a while on the getSomeOrder() call and then throws UnmarshallException, stating that it has failed to unmarshal the returned object, which basically means no implementation got downloaded.
    Can anyone help?

    You can try putting the Impl classes on a webserver.
    while starting the server set the property
    -Djava.rmi.server.codebase=http://mywebserver:8080
    While running the client if the impl classes are not available in the classpath, it would download it from the webserver

  • WaitFor() doesn't wait for my process to complete?

    Hi all,
    I'm launching a browser from my java program to display a text file, and when this is done i want to delete that text file from the server, so i tell the process that launches the browser to wait, then i make a call to delete the file from the server
    my code goes something like this:
    Process browserProc = Runtime.getRuntime().exec(<command to launch browser>);
    browserProc.waitFor();
    //here i call an external process to delete the file
    this works sometimes, but others the file is deleted before the browser gets to display it. what am i doing wrong?! if this is due to subprocesses being spawned is there any solution? any help is greatly appreciated!
    thanks and regards,
    emh3

    This is from some legacy code..urlToPointTo is the url
    of my file - does this fall into that category?Apparently it does. And it should, too. I can see the designers thinking "Should this command wait until the GUI is closed? No. Of course not. Obviously the user of this command only wants to launch the GUI. Why on earth would they want to wait until it is closed?"
    When you are having so much trouble doing something so simple, that's a good indication that you're doing something that isn't a good idea. Can you explain why you need to delete the remote file after it's displayed? Maybe that was your idea of how to implement some other requirement.

Maybe you are looking for

  • How do I change a calendar from read-only so that I can add/edit an event?

    From what I can figure out, iCal thinks that I have published my calendar. However, when I click on "Calendar", "Publish" is the only option. I have been able to add/edit in the past. I am not sure what I did to change it so that I am unable to add/e

  • Is it possible to copy only data only from a TM backup

    Here's my issue. Imac hard drive died last night. I have a full time Machine backup on the Imac on a Lacie external drive. I have an existing Mac Book that I use daily and don't want to reformat, but would like to simply add the pictures, music, docu

  • DW Crashes in Mac OS 10.4 on file save

    i am moving from a Windows environment to a Mac. I have created a site in DW(MX 8) with the files from the website most of the files are just fine I can edit them and save the file, however some of the XSLT files cause dream weaver to crash when I tr

  • How to trigger IDOC'S from SAP

    Hi All, How to trigger IDOC's from SAP(ECC 6)..where can we check this in mii 11.5 weather it is fail/success Thanks, Abhi

  • Reposting

    Does reposting line items update table BSEG?