Sending control codes to native program

Hello,
I execute a native application with Runtime.getRuntime().exec(), but the application does not return from proc.waitFor(). I feed the application from stdin. Other applications (e.g. cat) runs fine, so believe I have to terminate the input with a CTRL+D or something like this, but it does not work. How can I send a control code to the process?
I tried:
write('\u0004')
write('\u0003')
But why returns:
write('\u000D');
write('\u000A);
an error in the IDE?
Process proc = Runtime.getRuntime().exec(cmd+"\u0004");
BufferedInputStream bufferedIn = new BufferedInputStream(in);
outStream = new BufferedOutputStream(proc.getOutputStream());
errorStream = new BufferedReader(new InputStreamReader(proc
                         .getErrorStream()));
inStream = new BufferedReader(new InputStreamReader(proc
                         .getInputStream()));
int b;
while ((b = bufferedIn.read()) != -1) {
     outStream.write(b);
proc.waitFor();
Thanks, Karsten

Does not help. I flush and close the stream. Same result.
The program which does not work is a C program and waits until feof() says it. So, I also thought closing the stream would help to get an EOF, but it doesn't.
Message was edited by:
widerstand
Message was edited by:
widerstand

Similar Messages

  • Re: Sending control codes

    I have a process running that runs an MS-DOS program. The process runs happily but I am unable to terminate prematurely. How do I send a control code such as "CTRL+C" or "CTRL+Break" to the Process to terminate the program?
    Thanks in Advance
    Si

    When your Java program starts the job running:Process p = Runtime.getRuntime().exec("....");Your program can then kill that process like this:p.destroy();Check the API documentation for other things you could do with a Process.

  • How to send a  'ESC' to a native program

    Dear,
    I'm calling a native program using: Runtime.getRuntime().exec(cmd);
    This command opens cmd.exe.
    I use the outputstream to move to the right directory and open the desired program.
    The program executes properly but when it finishes, it asks to push the escape button to continue.
    How can I simulate the 'pressing of the escape button' via the outputstream?
    I already tried to send the entire ascii table(1 by 1) but the program doesn't terminate.
    Also tried the Robot class without success.
    Does someone knows how to handle this?
    Kind regards,
    Steven

    My life needs a "rewind/erase" button...
    camickr wrote:
    Either way, I'm afraid the Robot class does simulate events only in the current JVM. No, the Robot generates OS level events (is that the correct terminology), so the events are displatched to the application that has focusSorry, I made an unbacked assumption.
    OK so the problem may be to give the focus to the correct application.
    Here you have me a little confused (...) process.getInputStream() returns an InputStream, from the point of view of the launched native pogram, it's an OutputStream. The java program receives information via process.getInputStream().Yes, sorry, sorry, and sorry again. I wrote off memory without bothering a glance to the API, and I was absolutely wrong!
    I remember thinking "Remember that there's a trap in the naming of the methods..." :o)
    I'll try to remember as well "...and it is not what you thought!" :op
    The program that I'm calling does not have a GUI and it expects the pressing of the ESC-button on the keyboard.
    The program does not respond to the keyboard if the window is not active.That probably means the program does not read 'ESC' on its stdin, but merely listens for a "graphical" event indicating "key ESC pressed".
    In this case, as per camickr correction, Robot might generate this native event, but the app (or its launching window) will not receive it if it doesn't have the focus.
    One not-so-nice way could be to display the app window or terminal (using xterm -e /path/to/real/app on Unices, start \path\to\real\app on Windows, with various options to handle titles and pathes), and the user would have to click on this window and then type the 'ESC' key.
    A few words on the drawback:
    - how to automate giving the focus to the app terminal, so that the user doesn't have to click on it?
    Of course it depends on your application: is it general purpose app running on general purpose desktops, or worse portable across different OS? Then you're most probably stuck.
    I"ve had to work on constrained environments where our app were almost the only one to run, and managed the whole screen. When launching an external app from the main Java launcher, for some dedicated task, the main Java app would simply hide or iconify itself, and the forked app was the only active one.
    - how to automate typing the ESC key?
    See camickr reply about Robot being able to send a native event to the current focused app.
    - how to control (more or less) how the app terminal displays?
    Give up any hope of portability. But there are system-specific ways to fix a terminal's look (in the sense of "windowing-system-specific", two window managers on Linux will support different options).
    - how to pipe the launched app output to the Java window?
    First, that may not be necessary once you and the user have accepted that the native console will indeed show up. If you still want the app output, for display of to parse it from the Java launcher, then again look around system-specific options. e.g.:
    {code}xterm -l -lc <filename> -e /path/to/app{code}
    Edited by: jduprez on Jul 8, 2009 9:08 AM - fixed typo

  • Program that sends G-code pages to a machine tool's controller

    I am looking for some advice and examples (if possible) of programs that are able to send G-code programs to a CNC machine's controller.
    In other words I would like to build a program that could send the G-code program to the CNC brain of a machine tool (possibly through the serial port of the computer) . Also, I would like to read back programs from the CNC brain of a machine tool, bring them on the screen and possibly write an ASCII file that could be opened with notepad or word.
    Could somebody help?
    Thank you

    I think you want to use the parallel port rather than the serial port.  I've done what I think you want to do, but not in LabView. 
    I have a Taig benchtop milling machine that I built my own stepper control box for (based on the allegro chips).  It like every hobby CNC machine I've seen uses step and direction lines for each axis.  IE, when the direction line is pulled high, each pulse on the step line moves one direction, when the direction line is pulled low, each pulse moves the stepper the other way.  This very low-level of control is quite popular in CNC machine tools and allows the controller to blend axes for circles etc. 
    You've got a couple issues with trying to do this level of stepper control with LabView, the main issue is windows itself, the latencies out the parallel port is quite long due to the hardware abstraction layer in windows.  Second is the lack of determinism in windows.  So even after your pulses (IE data) start spewing out the serial port, there is no guarantee that all your data will come out in a smooth consistent manner.  Rather, there will be a splatter of data, a pause while windows does something else, then another splatter of data. 
    This is a real issue when controlling either steppers or servos with step and direction type of controls.  Because the step pulse train is directly linked to motor speed.  Any fast changes in the pulse train period will cause motor stalls or other very undesirable behavior.  You can get around this to some extent by working very slowly.
    My workaround is to use TurboCNC (you get the source code when you register), which is a turboPascal program that runs in DOS.  DOS is so simple that it's quite deterministic and you can get nice consistent pulse trains out the parallel port.  I use various windows programs to build my parts, and generate G-Code (Autodesk inventer, meshcam, MasterCam, etc).  I've also written some, not-for-prime-time, Labview routines to edit G-code, view toolpaths, and unroll loops, etc. 
    To use a non-real-time OS to control real-time critical tools like this, you can always build a hardware buffer.  Imagine a hardware Queue where your pulses are pushed into one side of the queue sporadically, and a hardware clock pops them out of the queue to your controller in nice smooth increments.  I've been toying with building such a thing, but honestly, the DOS turboCNC program works so well that it's not high on my list. 
    The beauty of DOS and turboCNC is that you can use a $40 small laptop to control your machine.  I have a 486 HP laptop sitting on top of my controller next to my mill.  Small, cheap and effective, everything I want. 
    Pushing your data out of the parallel port is fairly easy in LabView, and parsing G-code is also quite easy, but before you spend much time on it, make sure the data coming out your parallel port is suitable for your needs from a timing standpoint.
    Hope that helps,
    Sheldon
    Message Edited by Sheldon Stokes on 09-27-2005 09:01 AM
    Technical geek, engineer, research scientist, biodegradable...

  • Best way to send printer control codes?

    What's the best way to send printer control codes in Netware 3.12? Should I
    use a batch file that's run each time a particular queue is selected, or is
    there something I should be doing with a pconsole option? I'm trying to get
    rid of extra linefeeds and enable compressed printing. DOS environment, by
    the way.
    The printer in question is an Ithaca Pcos Series 50 ( #52 pn-06-0629), which
    isn't one of the standard ones listed in Pconsole etc. It may emulate a
    standard IBM though.
    Thanks-
    --Mike-- Chain Reaction Bicycles
    www.ChainReactionBicycles.com

    > What's the best way to send printer control codes in Netware 3.12? Should
    > I use a batch file that's run each time a particular queue is selected, or
    > is there something I should be doing with a pconsole option? I'm trying to
    > get rid of extra linefeeds and enable compressed printing. DOS
    > environment, by the way.
    Never mind, I'm in a habit of answering my own posts these days. Just create
    a job configuration in printcon that uses a device with the appropriate
    device modes.
    Is it just me, or is Netware queue-based printing a bit on the obtuse side?
    Seems like it could have been made a whole lot easier (more linear?) to set
    up.
    --Mike-- Chain Reaction Bicycles
    www.ChainReactionBicycles.com

  • Bought the paid version . I can not download the program . Did not send the code .

    Bought the paid version . I can not download the program . Did not send the code .

    Which version of Photoshop?

  • Table Control in Object oriented programing

    Hi ,
    All of our programs are converted into OO Programing, i have a requirement that can we have an alternative for Table Control in Object oriented programing ?
    can we have any base class for Table Control to display the data in the grid ?
    For Ex: we can place a ALVA Tree on the container , For this the base class is CL_GUI_ALVA_TREE, like the same way can we have any alternative,
    If i am not wrong is it possible by ALV grid Control.. can any body help me the out
    of this confusion.
    Thansk In Advance.
    Regards
    Nag

    Thanks for this, it is very help full. If you don't mind is there any demo program which is already given by SAP, or if you have please send me the code so that
    i can start looking on it .
    thanks In Advance.
    Regards
    Nag

  • How to read output of native program

    Hi,
    I wrote a Java program that runs a native program. In my case, the native program is written in C++ and runs under Linux.
    My purpose is, to start the native program and to capture the output of it and send also some input.
    I found the code to do this on this website. I used the Process and Runtime classes to start my native program, The I used the following code the intercept the output of the program:
    BufferedReader pInput = new BufferedReader(new InputStreamRead(process.getInputStream));
    This code works perfectly fine for a native program that does his job and then exit. I guess the the output is only printed when the native job has ended.
    That''s my problem, my program must continue to run, it never exits, so I never get the output of it except when I manualy close the program.
    Isn't there an other way to get the output real time of my program, without it to wait for the end of the program?
    Thanks

    my case, the native program is written in C++ and
    This code works perfectly fine for a native program
    that does his job and then exit. I guess the the
    output is only printed when the native job has
    ended.Although I 'don't do C' :), my guess is that your native app should close the output device it's using (and that the Java app is using for it's inputstream) and re-open it again.
    It shouldn't be needed to close your native application for this, only close the output device.
    I think :)
    Anne.

  • What is STB Remote Control code for the Magnavox 15MF400T/3​7 set?

    Does anyone know or know where to find the correct remote control code for the 15MF400T/37 set?

    If none of the codes worked, your only other option is to do a scan.
    WHAT IF NONE OF THE CODES WORKED?
    If none of the codes worked, try the following procedure. (As before, we will use the example of a TV. For other devices use the appropriate Device Key instead of the
    TV
    key in step 2 and 3.) 
    1. Turn on your TV.
    2. Press and hold the TV key.
    3. While holding down the TV key, press OK
    4. Release both keys. The Device Keys will blink twice.
    5. Press 9 - 2 - 2
    6. Point the remote at the TV.
    7. Press the play button 
    8. Press FF button . Every time you press the FF button the remote sends out a new power-off command to the TV. Keep pressing FF until the TV turns off.
    9. When the TV turns off, you have found the right code. Press OK  to store this code.
    Note: There are over 300 TV and DVD codes. The most common codes are tried first, but you may still need to press FF over 300 times to find the right code. If you reach the end of the list of codes the entire remote will flash twice and return to normal operation. You can exit programming at any time by pressing EXIT 
    If you do this and it still doesnt work, then your tv and the verizon remote dont have a common code and it will not work with your tv.
    ====================================================================================
    Error exists between keyboard and chair.

  • How to Populate Internal table data to Table Control in a Report Program

    Dear All,
           How to Populate Internal table data to Table Control in a Report Program? It is a pure report program with out any Module pool coding involved, which is just used to display data. Till now it is being displayed in a report. Now the user wants the data to be displayed in a table control. Could someone tell me how to go about with this.
    Thanks in Advance,
    Joseph Reddy

    If you want to use a table control, you will need to create a screen.
    In your report....
    start-of-selection.
    perform get_data.  " Get all your data here
    call screen 100. " Now present to the user.
    Double click on the "100" in your call screen statement.  This will forward navigate you to the screen.  If you have not created it yet, it will ask you if you want to create it, say yes.  Go into screen painter or layout of the screen.  Use the table control wizard to help you along the process.  It will write the code for you.  Since it is an output only table control, it will be really easy with not a lot of code. 
    A better way to present the data to the user would be to give it in a ALV grid.  If you want to go that way, it is a lot easier.  Here is a sample of the ALV function module.  You don't even have to create a screen.
    report zrich_0004
           no standard page heading.
    type-pools slis.
    data: fieldcat type slis_t_fieldcat_alv.
    data: begin of imara occurs 0,
          matnr type mara-matnr,
          maktx type makt-maktx,
          end of imara.
    * Selection Screen
    selection-screen begin of block b1 with frame title text-001 .
    select-options: s_matnr for imara-matnr .
    selection-screen end of block b1.
    start-of-selection.
      perform get_data.
      perform write_report.
    *  Get_Data
    form get_data.
      select  mara~matnr makt~maktx
                into corresponding fields of table imara
                  from mara
                   inner join makt
                     on mara~matnr = makt~matnr
                        where mara~matnr in s_matnr
                          and makt~spras = sy-langu.
    endform.
    *  WRITE_REPORT
    form write_report.
      perform build_field_catalog.
    * CALL ABAP LIST VIEWER (ALV)
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                it_fieldcat = fieldcat
           tables
                t_outtab    = imara.
    endform.
    * BUILD_FIELD_CATALOG
    form build_field_catalog.
      data: fc_tmp type slis_t_fieldcat_alv with header line.
      clear: fieldcat. refresh: fieldcat.
      clear: fc_tmp.
      fc_tmp-reptext_ddic    = 'Material Number'.
      fc_tmp-fieldname  = 'MATNR'.
      fc_tmp-tabname   = 'IMARA'.
      fc_tmp-outputlen  = '18'.
      fc_tmp-col_pos    = 2.
      append fc_tmp to fieldcat.
      clear: fc_tmp.
      fc_tmp-reptext_ddic    = 'Material'.
      fc_tmp-fieldname  = 'MAKTX'.
      fc_tmp-tabname   = 'IMARA'.
      fc_tmp-outputlen  = '40'.
      fc_tmp-col_pos    = 3.
      append fc_tmp to fieldcat.
    endform.
    Regards,
    Rich Heilman

  • Word2007 in windows 7 -There was a problem sending the command to the program!

    I just bought my new HP laptop with windows 7 Home premier edition, and then I installed windows office 2007 suite. It's ok if I only open the word without any existing word file. But if I open word with a word file, it says " there was a problem sending
    the command to the program". I try this action under safe mode, it's no problem, I can open an existing word file. If I open the winword.exe and use menu "file-open" to open a word file, it's alright. But If I double click a word file, it shows that error.
    I tried to change the registry information according to the solution on internet, but it doesn't work.  I checked the compatibility mode, it says run in "windows XP sp3", and it is grey, I can't uncheck it.
    Anyone got any idea to fix this problem?
    Thanks a lot.

    Hi
    Thank you for using
    Microsoft Office for IT Professionals Forums.
    From your description, This sounds like a problem with the file associations in Windows.. If there is any misunderstanding, please feel free to let
    me know.
    The first thing to check is to make sure that the file extensions are correctly associated with Word.
    1.      
    Click Start > type or copy following command to the Search box
    "C:\Program Files\Microsoft Office\Office12\winword.exe" /unregserver
    2.      
    You should then, immediately, use the following command:
    "C:\Program Files\Microsoft Office\Office12\winword.exe" /regserver
    Re-associate the Word file  manually:
    Please go to
    Start \Control Panel\Programs\Default Programs\Set Associations.
    Locate the files .doc, .docm,.docx, .dot, .dotm, check if there are associated with
    Microsoft Word. If not, highlight the file and click the
    Change Program button. Choose Microsoft Word from the list. If you are unable to see Microsoft Word from the list, click the
    Browse button. Browse to the folder: C:\Program Files\Microsoft Office\Office12, and choose
    WINWORD.EXE.
    Click
    OK to save the settings.
    Please take your time to try the suggestions and let me know the results at your earliest convenience. If anything is unclear or if there is anything
    I can do for you, please feel free to let me know.
    Hope that helps.
    Sincerely
    William Zhou CHN
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Multiple row selection & Send Email Code ? Need littel Help

    Dear All,
    I managed to insert a code which will enable me to select multiple rows (Artikel from the great Yann Duran),
    i also have a code which enables me to send a mail for each selected row (only one row).
    But now since I was able to select more rows, I need to to customize my "Send mail" code to send mail to all selected rows. I guess I will need a loop here but I am not sure.
    My code for multiy row selection :
    private const string _CONTROL = "vw_CustLedgerEntry" // This is my Data Grid;
    private DataGrid _ItemsList = null;
    private int _SelectedRowsCount = 0;
    partial void Part_2_CustomerItemDetail_InitializeDataWorkspace(List<IDataService> saveChangesTo)
    // Write your code here.
    this.FindControl(_CONTROL).ControlAvailable += Orders_ControlAvailable;
    private void Orders_ControlAvailable(object sender, ControlAvailableEventArgs e)
    _ItemsList = e.Control as DataGrid;
    //if the cast failed, just leave, there's nothing more we can do here
    if (_ItemsList == null)
    return;
    //set the property on the grid that allows multiple selection
    _ItemsList.SelectionMode = DataGridSelectionMode.Extended;
    _ItemsList.SelectionChanged += new SelectionChangedEventHandler(_ItemsList_SelectionChanged);
    private void _ItemsList_SelectionChanged(object sender, SelectionChangedEventArgs e)
    switch (_ItemsList == null)
    case true:
    _SelectedRowsCount = 0;
    break;
    case false:
    _SelectedRowsCount = _ItemsList.SelectedItems.Count;
    break;
    This is my code for sending a mail for one selected row:
    partial void EMail_Execute() // EMAIL BUTTON FOR OPEN ENTRIES
    if (vw_CustLedgerEntry.SelectedItem.Report_Type == null)
    // throw new ArgumentNullException();
    this.ShowMessageBox("EMail Can't be sent,PDF generation is not possible for this Entry");
    this.Application.ShowPart_2_CustomerItemDetail(this.vw_CustomerItem.Costomer_No_, this.vw_CustomerItem.Company);
    else// if (vw_CustLedgerEntry.SelectedItem.Send_Mail== true)
    //do
    vw_CustLedgerEntryItem1 entryItem = this.vw_CustLedgerEntry.SelectedItem;
    InvSendbyMailRequestBody reqBody = new InvSendbyMailRequestBody(
    entryItem.Document_No_
    , entryItem.Report_Type
    , "DynNavHRS"
    , this.Application.User.Name.Replace(@"HRS\", "") + "@hrs.com" // HRS001
    , "Document"
    , false
    , false
    , this.vw_CustomerItem.ISO_Code // Change 7.8.2014 Bug in Email body text sprache
    , this.vw_CustomerItem.Salesperson_E_mail // Change 7.8.2014 Bug in Send E-mail
    , entryItem.Customer_No_.ToString()
    , false
    , "XYZ"
    , false);
    InvSendbyMailRequest req = new InvSendbyMailRequest(reqBody);
    HRSReportServiceSoapClient wsHRS = new HRSReportServiceSoapClient();
    // wsHRS.InvSendbyMailCompleted += new EventHandler<InvSendbyMailCompletedEventArgs>(wsHRS_InvGetPDFCompleted);
    wsHRS.InvSendbyMailAsync(req);
    this.ShowMessageBox("Your email was successfully sent");
    // while (vw_CustLedgerEntry.SelectedItem.Send_Mail == true);
    Thaks a lot for your help.
    Zayed

    I tried the following but I donot know if its correct and Iam facing a problem with the "Foreach" function.
    private const string _CONTROL = "vw_CustLedgerEntry" // This is my Data Grid;
    private DataGrid _ItemsList = null;
    private int _SelectedRowsCount = 0;
    partial void Part_2_CustomerItemDetail_InitializeDataWorkspace(List<IDataService> saveChangesTo)
    // Write your code here.
    this.FindControl(_CONTROL).ControlAvailable += Orders_ControlAvailable;
    private void Orders_ControlAvailable(object sender, ControlAvailableEventArgs e)
    _ItemsList = e.Control as DataGrid;
    //if the cast failed, just leave, there's nothing more we can do here
    if (_ItemsList == null)
    return;
    //set the property on the grid that allows multiple selection
    _ItemsList.SelectionMode = DataGridSelectionMode.Extended;
    _ItemsList.SelectionChanged += new SelectionChangedEventHandler(_ItemsList_SelectionChanged);
    private void _ItemsList_SelectionChanged(object sender, SelectionChangedEventArgs e)
    switch (_ItemsList == null)
    case true:
    _SelectedRowsCount = 0;
    break;
    case false:
    _SelectedRowsCount = _ItemsList.SelectedItems.Count;
    break;
    partial void Send_Multiple_Mail_CanExecute(ref bool result)
    //only enable rows have actually been selected
    result = (_SelectedRowsCount > 0);
    partial void Send_Multiple_Mail_Execute()
    if (_ItemsList == null) { return; }
    //StringBuilder names = new StringBuilder();
    //loop through the selected rows
    //we're casting each selected row as a DemoItem
    //so we get access to all the properties of the entity that the row represents
    foreach (_ItemsList.SelectedItems)
    vw_CustLedgerEntryItem1 entryItem = this.vw_CustLedgerEntry.SelectedItem;
    InvSendbyMailRequestBody reqBody = new InvSendbyMailRequestBody(
    entryItem.Document_No_
    , entryItem.Report_Type
    , "DynNavXYZ"
    , this.Application.User.Name.Replace(@"HRS\", "") + "@hrs.com" // HRS001
    , "Document"
    , false
    , false
    , this.vw_CustomerItem.ISO_Code // Change 7.8.2014 Bug in Email body text sprache
    , this.vw_CustomerItem.Salesperson_E_mail // Change 7.8.2014 Bug in Send E-mail
    , entryItem.Customer_No_.ToString()
    , false
    , "XYZ"
    , false);
    InvSendbyMailRequest req = new InvSendbyMailRequest(reqBody);
    XYZReportServiceSoapClient wsHRS = new HRSReportServiceSoapClient();
    // wsHRS.InvSendbyMailCompleted += new EventHandler<InvSendbyMailCompletedEventArgs>(wsHRS_InvGetPDFCompleted);
    wsHRS.InvSendbyMailAsync(req);
    this.ShowMessageBox("Your email was successfully sent");

  • How to change the attributes of GUI CONTROLS in my own program.

    hi all,
    i just want to change the attributes of GUI CONTROLS in my own program.
    for example `
    How to set an ICON on my GUI BUTTON in the program?
    so what's the mapping between CONTROL in the SCREEN PAINTER and variable in the program?

    Hi Chao Liu,
    Ya , u first find out the PF-STATUS of the screen and goto that status and now u can modify the ICON u want .
    Finding the GUI status of the screen
    Goto that  TRANSACTION CODE or SCREEN
    On the Standard Menu bar Goto ( Menu path) System --> Status
    Now u get a pop-up System :status in that in SAP Data block u can find GUI Status. Now Double Click on that Status. It takes u to the Status of that screen.
    Now click on the Display --> Change Button on the application tool bar.
    If it is a standard GUI-status then it asks for the ACCESS KEY.
    if it is a custom defined GUI Status  then u can change the status .
    reward if helpful
    raam

  • IOS 6 keeps crashing non-native programs

    I recently upgraded my iPod touch to iOS 6 and non-native programs keep crashing.  Important programs that I need for work!! I took it to that Applestore and an employee told me that I just have to wait for the non-native program writers to send me updates. 
    Can I just switch back to the old OS?

    All we can say in this Apple forum is that downgrading the IOS is not support by Apple.
    Sometimes this works, at least for some apps.
    - Reset the iPod. Nothing will be lost
    Reset iPod touch: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Reset all settings
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup
    - Restore to factory settings/new iPod.

  • Version Control of PL/SQL programs in Database

    Is there a version control feature available in Oracle v9.x ???
    I am trying to implement version control on PL/SQL programs(Packages/Functions/Procedures). I should be able to rollback to old version and keep the system running if the latest ones failed. This should be done automatically without bringing the database down or recompiling the PL/SQL programs and also users do not need to reconnect(users might be caught in a LOCK and might get their sessions killed by DBA...)
    Ex: I have heard that in .NET, u can have more than one version of a DLL and have only one version active. If we want to go back to the old version of the DLL, u don't need to recompile the DLL to make it active. I am looking something similar to this....
    I have thought of several ways like creating a small repository table for my PL/SQL programs and store the PL/SQL code in the repository and based on the situation, compile only that program (which might be a OLD or a NEW version) and so forth... But this does not satisfy the requirement of rolling back to the old version without recompiling.(RENAMING a PL/SQL program feature doesn't seem to be implemented yet...)
    I don't want to use Designer just for this purpose...
    Any ideas..
    Thanks,
    Purush

    Are you dealing with code that's being called remotely (i.e. via a database link)?
    No
    I'd be concerned about the concept of rolling back code changes in production on a regular basis-- that would seem to indicate problems that ought to be addressed in development and QA. Rolling back code in production seems like it ought to be a rather painful process, if only because it indicates a massive failure elsewhere.
    This is not on a regular basis at all. Our Database applications are tied with lots of programs which directly control the robots and machines. Certain machines and robots needs to be working all the time and any downtime will cost time and money. To make sure that the implementation goes into production smoothly(without shutting down machines and robots) and then into maintainance mode, we are looking for some kind of source control to control the implementation and make sure to revert back (without shutting down machines and robots) if there are major issues.(There are certain things here which cannot be tested outside of a shop floor due to the physical and other constraints.)
    I have thought of otherways like a compile flag (in the DB.. Ex: a packaged variable) to set before compiling and reset after compiling. The programs on the shopfloor will always read this flag and check buffer(time taken to do this will have to be considered) before calling a DB txns and if the flag is set, buffer the txns and and move on to the next task the machine should do. The next time it call a txn. if the flag is reset, it checks the buffer and if buffer exists, execute the buffer txns first.. and then proceed to actual txn. The things that bothers me is time taken to compile the huge package and the no. of txns getting buffered and the overall txn time.
    I am trying to come up with some kind of solution for this issue if possible.....
    Thanks,
    Purush

Maybe you are looking for