Petalinux pthread_create does not create new thread?

The attached test program creates two detached threads. When I run the app and look at the processes in top, I cannot find individual entries for each thread. I tried typing H with top running, but this did not show me any additional information.
Does this mean that my pthreads are not being created as separate threads somehow?
A side effect of this is that if the ioctl call made by each thread is blocking, the entier process blocks until the ioctl returns, not just the thread that made the call. In the example below, I have worked around this by making the ioctl non-blocking, but now the process consumes the CPU, which is, of course, undesirable.
Thanks, in advance, for your help.
Well, for some reason, the system won't let me attach my source file, so here it is...
 * Placeholder PetaLinux user application.
 * Replace this with your application code
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <net/if.h>
#include <pthread.h>
#define FP_IOCTL_CMD  SIOCDEVPRIVATE + 14
#define PPS_IOCTL_CMD SIOCDEVPRIVATE + 1
void* wait_for_frame_pulse(void* arg) {
  int sd;
  int ioctl_result = 0;
  unsigned short fod = 0;
  int flags;
  // setsockopt(sd, SOL_SOCKET, SO_BINDTODEVICE, "ad160", 5);
  struct ifreq ifr;
  memset(&ifr, 0, sizeof(struct ifreq));
  if ((sd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
    printf("Socket error!\n");
    pthread_exit(NULL);
  flags = fcntl(sd, F_GETFL, 0);
  /* if (fcntl(sd, F_SETFL, O_NONBLOCK) < 0) { */
  /*   printf("fcntl error! %s\n", strerror(errno)); */
  /*   pthread_exit(NULL); */
  strcpy(ifr.ifr_name, "ad160");
  printf("About to start frame pulse waiting cycle.\n");
  while (1) {
    /* printf("Waiting for frame pulse: %d\n", fod%200); */
    while (ioctl(sd, FP_IOCTL_CMD, &ifr) == -1) {
      if (errno != EWOULDBLOCK) {
    printf("AD16NET FP IOCTL failed: %s\n", strerror(errno));
    pthread_exit (NULL);
    /* printf("%d: GOT A FRAME PULSE!\n", fod%200); */
    ++fod;
  pthread_exit(NULL);
void* wait_for_pulse_per_second(void* arg) {
  int sd;
  unsigned short sod = 0;
  int flags;
  // setsockopt(sd, SOL_SOCKET, SO_BINDTODEVICE, "ad160", 5);
  struct ifreq ifr;
  memset(&ifr, 0, sizeof(struct ifreq));
  if ((sd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
    printf("Socket error!\n");
    pthread_exit(NULL);
  flags = fcntl(sd, F_GETFL, 0);
  /* if (fcntl(sd, F_SETFL, flags | O_NONBLOCK) < 0) { */
  /*   printf("fcntl error! %s\n", strerror(errno)); */
  /*   pthread_exit(NULL); */
  strcpy(ifr.ifr_name, "ad160");
  printf("About to start pulse per second waiting cycle.\n");
  while (1) {
    /* printf("Waiting for pulse per second: %d\n", sod); */
    while (ioctl(sd, PPS_IOCTL_CMD, &ifr) == -1) {
      if (errno != EWOULDBLOCK) {
    printf("AD16NET PPS IOCTL failed: %s\n", strerror(errno));
    pthread_exit (NULL);
    /* printf("%d: GOT A PPS!\n", sod); */
    ++sod;
  pthread_exit(NULL);
int main(int argc, char *argv[])
  int s, thread_id_pps, thread_id_fp;
  pthread_attr_t attr;
  struct timespec sleep_time;
  sleep_time.tv_sec = 1;
  sleep_time.tv_nsec = 0;
    printf("Hello, PetaLinux World!\n");
    printf("cmdline args:\n");
    while(argc--)
        printf("%s\n",*argv++);
    s = pthread_attr_init(&attr);
    if (s != 0) {
      perror("pthread_attr_init");
      exit(-1);
    s = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
    if (s != 0) {
      perror("pthread_attr_setdetachstate");
      exit(-1);
    s = pthread_create(&thread_id_fp,
               &attr,
               &wait_for_frame_pulse,
               NULL);
    if (s) {
      perror("pthread_create 1");
      exit (-1);
    s = pthread_create(&thread_id_pps,
               &attr,
               &wait_for_pulse_per_second,
               NULL);
    if (s) {
      perror("pthread_create 2");
      exit (-1);
    pthread_attr_destroy(&attr);
    /* wait_for_pulse_per_second(); */
    /* if (pthread_detach(thread_id_fp)) { */
    /*   perror("pthread_detach 1"); */
    /*   exit (-1); */
    /* if (pthread_detach(thread_id_pps)) { */
    /*   perror("pthread_detach 2"); */
    /*   exit (-1); */
#if 0
    int pid = fork();
    if (pid == 0) {
      wait_for_frame_pulse();
    else if (pid > 0) {
      wait_for_pulse_per_second();
    else {
      printf("fork() failed!\n");
      return 1;
#endif
    pthread_exit(NULL);
    /* while (1) {nanosleep(&sleep_time, NULL);} */
    /* return 0; */

Actually, that's what I did. I typed "H" while top was running. I just tried it again, and pasted the result, below. Pressing "H" only refreshes the display, nothing else. Also, when I type "top -H" I get the Usage statement, which tells me that the "-H" is not supported.
Also, since this is a network device, it doesn't appear that there is an option to do an "ioctl_unlocked". The only ioctl specified in struct net_device_ops is "ndo_do_ioctl."
Of course, being a newb, I could be missing something.
Mem: 36824K used, 995664K free, 0K shrd, 734928K buff, 734976K cached
CPU: 13.2% usr 83.6% sys  0.0% nic  3.0% idle  0.0% io  0.0% irq  0.0% sirq
Load average: 2.39 0.68 0.23 3/45 882
  PID  PPID USER     STAT   VSZ %VSZ CPU %CPU COMMAND
  877   873 root     Z        0  0.0   1 96.6 [AD16NET_test]
  873     1 root     S     2956  0.2   0  0.0 -sh
  882   873 root     R     2956  0.2   0  0.0 top
  817     1 root     S     2852  0.2   0  0.0 /sbin/inetd
  857     1 root     S     2764  0.2   0  0.0 udhcpc -R -b -p /var/run/udhcpc.et
  875     1 root     S     2764  0.2   1  0.0 /sbin/httpd -h /srv/www
    1     0 root     S     1860  0.1   0  0.0 init [5]
  393     2 root     RW       0  0.0   1  0.0 [kworker/1:1]
    6     2 root     SW       0  0.0   0  0.0 [kworker/u4:0]
   17     2 root     SW       0  0.0   0  0.0 [kworker/u4:1]
    7     2 root     SW       0  0.0   1  0.0 [rcu_preempt]
   49     2 root     SW       0  0.0   0  0.0 [kworker/0:1]
    2     0 root     SW       0  0.0   1  0.0 [kthreadd]
    3     2 root     SW       0  0.0   0  0.0 [ksoftirqd/0]
    4     2 root     SW       0  0.0   0  0.0 [kworker/0:0]
    5     2 root     SW<      0  0.0   0  0.0 [kworker/0:0H]
    8     2 root     SW       0  0.0   0  0.0 [rcu_sched]
    9     2 root     SW       0  0.0   0  0.0 [rcu_bh]
   10     2 root     SW       0  0.0   0  0.0 [migration/0]
   11     2 root     SW       0  0.0   1  0.0 [migration/1]
 

Similar Messages

  • Mail does not create new emails based on the highlighted mailbox, but rather the receiving mailbox of whatever individual email happens to be highlighted. This was not the case prior to Lion. Is this a bug or an error on my part?

    Mail does not create new emails based on the highlighted mailbox, but rather according the receiving mailbox of whatever individual email happens to be highlighted. This was not the case prior to Lion. Is this a bug or an error on my part? (I do have the setting for creating new emails from the highlighted mailbox checked.)

    The questions about time was not only because of thinking about the Time Machine, but also possible impact on recognizing which messages remaining on a POP server (doesn't apply to IMAP) have been already downloaded. In the Mail folder, at its root level, in Mail 3.x there is a file named MessageUidsAlreadyDownloaded3 that should prevent duplicate downloading -- some servers may not communicate the best with respect to that, and the universal index must certainly be involved in updating that index file. If it corrupts, it can inhibit proper downloading. However, setting the account up in a New User Account and having the same problem does not point that way, unless your POP3 server is very different from most.
    That universal index is also typically involved when messages are meant to be moved from the Inbox to another mailbox -- in Mail 3.x the message does not move, but rather is copied, and then erased from the origin mailbox. That requires updating the Envelope Index to keep track of where the message is, and should keep track of where it is supposed to have been removed after the "Move".
    Ernie

  • ARD 3.3.2 does not create new reports

    Hi all!
    I am running ARD 3.3.2 on my MacBook Pro with Mac OS X 10.6.2
    All my clients are on ARD client 3.3.2 as well but run Mac OS X 10.4.11 or 10.5.8.
    Since I've updated to 10.6 and ARD 3.3.2 i am not able to create new reports (with rebuild with new data check box activated) on any client system. ARD starts the task and stays in the status "waiting for report data" (which is translated from its German version and might be called a little different in English).
    And there it stays--- for a very long time until I get an task failed message.
    All clients are in the same network segment as I am. I am able to observe and control all machines as well as copy and install software onto them. Clients have no firewall activated.
    All clients have one Admin User installed , which is allowed to make full use of ARD functions. When adding the clients to my ARD Computer list I used this Admin User credentials.
    Does the new ARD doesn't support older OSses any more??
    Any ideas , how am I able to solve this and get reports going again???
    Thanx
    Holger
    Message was edited by: Holger Bartsch (added some more detail to client setup)

    I manage 400+ computers at a University using ARD 3.3.2 with Client 3.3.2. I can not generate reports and haven't been able ever since Snow Leopard came out. We also have a developer account and there is no upgrade or version 4 in the works. Perhaps Apple's focus on giving iChat remote access has made them forget about Apple Remote Desktop, which is a shame because it's such a wonderful product.
    We've been looking at Net School Support [http://www.netsupportschool.com/audio.asp] It's not as robust, but I can't continue spending money on a product/company that doesn't care about it's customer's problems. In general Apple's enterprise software efforts seem to be losing functionality instead of improving. OS 9 ARD had audio chat features, non-freezing screen lock and of course, working report generation.

  • Dragging folder of photos does not create new roll

    The help system says if I drag an entire folder into the photo viewing area, iPhoto 4 creates a new roll. But when I try it, it just sorts them all into by date year folders -- often incorrectly.
    Can someone tell me what I'm doing wrong?
    Thanks.

    Thanks for the tip on viewing rolls, but with the dates not sorting properly, it's really kind of messing me up.
    Each separate import creates a new film roll. If you select multiple folders and drag into iPhoto, you will get a roll for each folder. If those folders contain subfolders, they may confuse iPhoto. It's best to do this with folders that do not have subfolders.
    Also, what I really need is to drop a whole folder in and have that be accepted as a roll by itself, i.e., no further date sorting.
    That IS what happens. You can check this for yourself. Immediately after importing a folder, select the "Last Roll" smart album. (If your version has this, it is near the top of the Source Pane just below Library.) Be sure that you have Film Rolls selected for your View, and you'll see the roll and its title. The title should be the same as the name of the folder you imported. Select the roll (click it's title header) and look at the date of the Film Roll. Note that there are 3 dates there: "date" just below title, and "from" and "to" dates below "time." The from and to should give the date of the earliest and latest photo in that roll. To edit those dates, you must select each of those photos and edit the photo date.
    What you should check is that first "date". It is the date which represents the entire Film Roll. You can edit it there in the Info Pane. That date is independent of the photo dates. It can be handy to change it, because Film Rolls will display in your library in chronological order based on this date. It can also be confusing if this date is wrong, because a roll you expect to find at the top or bottom of your list may be filed somewhere else. Correct the roll date, and you correct that problem. As I said before, this date could be causing your photos to be filed into the wrong Year Smart Albums, even if the dates on the individual photos are correct.
    Regards.

  • AX does not creat new network?

    Trying to set up 2 AX to extend an existing wireless network (created by an modem/router), I instead chose to have one AX create a new network and have the second AX extend the one created by AX 1. Ax #1 - BASE - is connected to the router by cable, and is configured to create a new network. Configuration is fine - Green light and no problems. However - no new network can be found. My MacBookPro only finds the original network created by the router - not anything created by the AX.

    Please check your settings on AX#1 using AirPort Utility - Manual Setup.
    Click the Wireless tab below the row of icons
    Wireless Mode - Create a Wireless Network
    Wireless Network Name - Your choice
    Check mark next to Allow this network to be extended
    Channel - Automatic
    Radio Mode - Your choice
    Security - Your choice
    Password - Your choice
    Now click the Internet icon at the top of the page
    Connection Sharing at the bottom of the next page must be set to "Off (Bridge Mode)"
    Update to save settings
    On AX#2 AirPort Utility - Manual Setup
    Wireless Mode - Extend a wireless network
    Wireless Network Name - Select the network created by AX#1
    Check mark next to Allow wireless clients
    Security - Exact same setting as AX#1
    Password - Exact same setting as AX#1
    Please post back on your results.

  • Mail dock icon does not create new message when a file is dragged onto it

    After installing Snow Leopard, dragging a file to the the Mail icon in the dock no longer creates a new message with the file attached. Mail is brought forward as the active application, just no new message window.
    This was the behavior in earlier versions of mail.
    Is there a preference, or any other change, that can be changed to allow drag-and-drop of a file to create a new message with an attachment?
    --James

    There are some issues with drag and drop. I was having the same issue with Mail with SL, but I didn't check after 10.6.1. However, I just installed a new hard drive, and migrated. Mail works for me, now.
    It didn't work with my 10.6 which had been upgraded with multiple builds in the beta. I assumed it was related to the other drag and drop issues. Now that I check it again, I don't think so.

  • Payment Wizard Does not create the File

    Hi I am trying to run the payment wizard and in the final step it says it ran successful and create the outgoing payments but it does not create the payment file for the bank.
    Step 1
                Start a new Payment run
    Step 2
               payment type : out going
               payment method : bank transfer
               File Path : Go to Desktop and file name is test
    Step3
              Select the business partner
    Step 4
             Select the date range
    Step 5
            Select the payment method
    Step 6
            Select the Invoices
    Step 7
            Execute
    It says successfully Executed the payment and create outgoing payment for the business partner.
    But it does not create the payment file (test in the Desktop)
    Please help me!!!
    Thanks
    Sanjaya

    Hi Sanjaya,
    Check the link
    Payment Wizard
    Payment Wizard Run does not create Payment/Check
    Payment Wizard/Engine - creation of Bank File
    *Close the thread if issue solved.
    Regards
    Jambulingam.P

  • Adobe After Effects CC 2014 Multi-machine rendering does not create RCF after Collect-File

    This was working in the previous release.  After going through all of the steps to perform a multi-machine render, not only does it say it is limiting it to 5 machines instead of the usual 99 (and I have over 100 cores on the render farm) but "Collect Files" (File/Dependencies/Collect Files) does not create the Render Control File (RCF) that kicks off the process on the other machines, like it did before and is supposed to do.
    This release was supposed to fix the 32 core limitation on render nodes (my server has 48), but now does nothing at all.
    Anyway, I assume there is a check box somewhere that says "do something" that hasn't been checked and another that says "Maybe my machine has more than 5 cores", and I would appreciate being steered in the direction of these new mis-features.
    Just as background, the 48 core server does show the little TV screen that monitors the watch folder, and I know for a fact that process looks for the "RCF" file.  Looking at the directory specified for "collect files", I can see that no RCF file is created, only 1 file, a report.txt file which contains this information is produced:
    Report created:
      7/9/2014 1:54:12 AM
    Project name: highup.aep
    Source files collected to:
      P:\temp\highup folder
    Source files collected: All
    Collected comps: 
      Thomas Falke - High Again High On Emotion)
    Number of collected files:  1
    Size of collected files:  63.4 MB
    Collected source files:
      C:\Users\Jeff K\Videos\Down\2014-2015\Thomas Falke - High Again High On Emotion).mp4
    Rendering plug-ins:
      Classic 3D
    Effects used:  1
    Effect:  Detail-preserving Upscale

    The dialog box has been slightly refactored.  You must click "Allow watch folder rendering" and then all is good.  Hope this helps anyone else.  Thanks to Rafil at customer support chat for this.

  • SQLJ Translation does not create profile file

    SQLJ Translation does not create profile file.
    After translating a small file HelloWorld.sqlj
    the following files are created:
    HelloWorld_SJProfileKeys.class
    HelloWorld.class
    HelloWorld.java
    Although there is a HelloWorld_SJProfileKeys.class, profile file HelloWorld_SJProfile0.ser has NOT been created.
    The starting file .sqlj file HelloWorld.sqlj is taken from O'Reilly book 'Java Programming with Oracle SQLJ' by Jason Price. The file contains a valid SQL statement to display the date.
    My environment variables were set up with instructions from:
    http://www.onjava.com/pub/a/onjava/2001/12/05/learning_sqlj.html
    When I run java HelloWorld to run the .java file, I get the error:
    SQLException java.sql.SQLException: profile HelloWorld_SJProfile0 not found: java.lang.ClassNotFoundException: HelloWorld_SJProfile0
    I searched the internet high and low for a similar error to mine but I could not find a match.
    I read the following text from http://otn.oracle.com/tech/java/sqlj_jdbc/htdocs/faq.html#translationerrors
    but it does not help me.
    "ClassNotFoundException: xxx.yyy_SJProfile0 for class xxx.yyy_SJProfileKeys
    If you see an exception such as:
    java.sql.SQLException: profile xxx.yyy_SJProfile0 not found:
    java.lang.ClassNotFoundException:
    xxx.yyy_SJProfile0 for class xxx.yy_SJProfileKeys
    then you must ensure that the SQLJ profile(s), such as xxx/yyy_SJProfile0.ser, is available in the SQLJ runtime environment. This includes JARing this file as part of an applet deployment, or publishing it to the server via loadjava.
    Any ideas? Thanks in advance,
    John
    Helloworld.sqlj before translation:
    The program HelloWorld.sqlj illustrates how to connect to a
    database, and display the words "Hello World" along with
    the current date.
    // import required packages
    import java.sql.Date;
    import java.sql.SQLException;
    import oracle.sqlj.runtime.Oracle;
    public class HelloWorld {
    public static void main(String [] args) {
    java.sql.Date current_date;
    try {
    // connect to the database
    Oracle.connect(
    "jdbc:oracle:thin:@localhost:1521:orac",
    "scott",
    "tiger"
    // get the current date from the database
    #sql { SELECT sysdate INTO :current_date FROM dual };
    // display message
    System.out.println("Hello World! The current date is " +
    current_date);
    } catch ( SQLException e ) {
    System.err.println("SQLException " + e);
    } finally {
    try {
    // disconnect from the database
    Oracle.close();
    } catch ( SQLException e ) {
    System.err.println("SQLException " + e);
    } // end of main()
    HelloWorld.java after translation:
    /*@lineinfo:filename=HelloWorld*//*@lineinfo:user-code*//*@lineinfo:1^1*//*
    The program HelloWorld.sqlj illustrates how to connect to a
    database, and display the words "Hello World" along with
    the current date.
    // import required packages
    import java.sql.Date;
    import java.sql.SQLException;
    import oracle.sqlj.runtime.Oracle;
    public class HelloWorld {
    public static void main(String [] args) {
    java.sql.Date current_date;
    try {
    // connect to the database
    Oracle.connect(
    "jdbc:oracle:thin:@localhost:1521:orcl",
    "scott",
    "tiger"
    // get the current date from the database
    /*@lineinfo:generated-code*//*@lineinfo:28^7*/
    // #sql { SELECT sysdate  FROM dual  };
    sqlj.runtime.profile.RTResultSet __sJT_rtRs;
    sqlj.runtime.ConnectionContext __sJT_connCtx = sqlj.runtime.ref.DefaultContext.getDefaultContext();
    if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_CONN_CTX();
    sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext();
    if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX();
    synchronized (__sJT_execCtx) {
    sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, HelloWorld_SJProfileKeys.getKey(0), 0);
    try
    sqlj.runtime.profile.RTResultSet __sJT_result = __sJT_execCtx.executeQuery();
    __sJT_rtRs = __sJT_result;
    finally
    __sJT_execCtx.releaseStatement();
    try
    sqlj.runtime.ref.ResultSetIterImpl.checkColumns(__sJT_rtRs, 1);
    if (!__sJT_rtRs.next())
    sqlj.runtime.error.RuntimeRefErrors.raise_NO_ROW_SELECT_INTO();
    current_date = __sJT_rtRs.getDate(1);
    if (__sJT_rtRs.next())
    sqlj.runtime.error.RuntimeRefErrors.raise_MULTI_ROW_SELECT_INTO();
    finally
    __sJT_rtRs.close();
    /*@lineinfo:user-code*//*@lineinfo:28^58*/
    // display message
    System.out.println("Hello World! The current date is " +
    current_date);
    } catch ( SQLException e ) {
    System.err.println("SQLException " + e);
    } finally {
    try {
    // disconnect from the database
    Oracle.close();
    } catch ( SQLException e ) {
    System.err.println("SQLException " + e);
    } // end of main()
    }/*@lineinfo:generated-code*/class HelloWorld_SJProfileKeys
    private static HelloWorld_SJProfileKeys inst = null;
    public static java.lang.Object getKey(int keyNum)
    throws java.sql.SQLException
    if (inst == null)
    inst = new HelloWorld_SJProfileKeys();
    return inst.keys[keyNum];
    private final sqlj.runtime.profile.Loader loader = sqlj.runtime.RuntimeContext.getRuntime().getLoaderForClass(getClass());
    private java.lang.Object[] keys;
    private HelloWorld_SJProfileKeys()
    throws java.sql.SQLException
    keys = new java.lang.Object[1];
    keys[0] = sqlj.runtime.ref.DefaultContext.getProfileKey(loader, "HelloWorld_SJProfile0");
    }

    SQLJ Translation does not create profile file.
    After translating a small file HelloWorld.sqlj
    the following files are created:
    HelloWorld_SJProfileKeys.class
    HelloWorld.class
    HelloWorld.java
    Although there is a HelloWorld_SJProfileKeys.class, profile file HelloWorld_SJProfile0.ser has NOT been created.
    The starting file .sqlj file HelloWorld.sqlj is taken from O'Reilly book 'Java Programming with Oracle SQLJ' by Jason Price. The file contains a valid SQL statement to display the date.
    My environment variables were set up with instructions from:
    http://www.onjava.com/pub/a/onjava/2001/12/05/learning_sqlj.html
    When I run java HelloWorld to run the .java file, I get the error:
    SQLException java.sql.SQLException: profile HelloWorld_SJProfile0 not found: java.lang.ClassNotFoundException: HelloWorld_SJProfile0
    I searched the internet high and low for a similar error to mine but I could not find a match.
    I read the following text from http://otn.oracle.com/tech/java/sqlj_jdbc/htdocs/faq.html#translationerrors
    but it does not help me.
    "ClassNotFoundException: xxx.yyy_SJProfile0 for class xxx.yyy_SJProfileKeys
    If you see an exception such as:
    java.sql.SQLException: profile xxx.yyy_SJProfile0 not found:
    java.lang.ClassNotFoundException:
    xxx.yyy_SJProfile0 for class xxx.yy_SJProfileKeys
    then you must ensure that the SQLJ profile(s), such as xxx/yyy_SJProfile0.ser, is available in the SQLJ runtime environment. This includes JARing this file as part of an applet deployment, or publishing it to the server via loadjava.
    Any ideas? Thanks in advance,
    John
    Helloworld.sqlj before translation:
    The program HelloWorld.sqlj illustrates how to connect to a
    database, and display the words "Hello World" along with
    the current date.
    // import required packages
    import java.sql.Date;
    import java.sql.SQLException;
    import oracle.sqlj.runtime.Oracle;
    public class HelloWorld {
    public static void main(String [] args) {
    java.sql.Date current_date;
    try {
    // connect to the database
    Oracle.connect(
    "jdbc:oracle:thin:@localhost:1521:orac",
    "scott",
    "tiger"
    // get the current date from the database
    #sql { SELECT sysdate INTO :current_date FROM dual };
    // display message
    System.out.println("Hello World! The current date is " +
    current_date);
    } catch ( SQLException e ) {
    System.err.println("SQLException " + e);
    } finally {
    try {
    // disconnect from the database
    Oracle.close();
    } catch ( SQLException e ) {
    System.err.println("SQLException " + e);
    } // end of main()
    HelloWorld.java after translation:
    /*@lineinfo:filename=HelloWorld*//*@lineinfo:user-code*//*@lineinfo:1^1*//*
    The program HelloWorld.sqlj illustrates how to connect to a
    database, and display the words "Hello World" along with
    the current date.
    // import required packages
    import java.sql.Date;
    import java.sql.SQLException;
    import oracle.sqlj.runtime.Oracle;
    public class HelloWorld {
    public static void main(String [] args) {
    java.sql.Date current_date;
    try {
    // connect to the database
    Oracle.connect(
    "jdbc:oracle:thin:@localhost:1521:orcl",
    "scott",
    "tiger"
    // get the current date from the database
    /*@lineinfo:generated-code*//*@lineinfo:28^7*/
    // #sql { SELECT sysdate  FROM dual  };
    sqlj.runtime.profile.RTResultSet __sJT_rtRs;
    sqlj.runtime.ConnectionContext __sJT_connCtx = sqlj.runtime.ref.DefaultContext.getDefaultContext();
    if (__sJT_connCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_CONN_CTX();
    sqlj.runtime.ExecutionContext __sJT_execCtx = __sJT_connCtx.getExecutionContext();
    if (__sJT_execCtx == null) sqlj.runtime.error.RuntimeRefErrors.raise_NULL_EXEC_CTX();
    synchronized (__sJT_execCtx) {
    sqlj.runtime.profile.RTStatement __sJT_stmt = __sJT_execCtx.registerStatement(__sJT_connCtx, HelloWorld_SJProfileKeys.getKey(0), 0);
    try
    sqlj.runtime.profile.RTResultSet __sJT_result = __sJT_execCtx.executeQuery();
    __sJT_rtRs = __sJT_result;
    finally
    __sJT_execCtx.releaseStatement();
    try
    sqlj.runtime.ref.ResultSetIterImpl.checkColumns(__sJT_rtRs, 1);
    if (!__sJT_rtRs.next())
    sqlj.runtime.error.RuntimeRefErrors.raise_NO_ROW_SELECT_INTO();
    current_date = __sJT_rtRs.getDate(1);
    if (__sJT_rtRs.next())
    sqlj.runtime.error.RuntimeRefErrors.raise_MULTI_ROW_SELECT_INTO();
    finally
    __sJT_rtRs.close();
    /*@lineinfo:user-code*//*@lineinfo:28^58*/
    // display message
    System.out.println("Hello World! The current date is " +
    current_date);
    } catch ( SQLException e ) {
    System.err.println("SQLException " + e);
    } finally {
    try {
    // disconnect from the database
    Oracle.close();
    } catch ( SQLException e ) {
    System.err.println("SQLException " + e);
    } // end of main()
    }/*@lineinfo:generated-code*/class HelloWorld_SJProfileKeys
    private static HelloWorld_SJProfileKeys inst = null;
    public static java.lang.Object getKey(int keyNum)
    throws java.sql.SQLException
    if (inst == null)
    inst = new HelloWorld_SJProfileKeys();
    return inst.keys[keyNum];
    private final sqlj.runtime.profile.Loader loader = sqlj.runtime.RuntimeContext.getRuntime().getLoaderForClass(getClass());
    private java.lang.Object[] keys;
    private HelloWorld_SJProfileKeys()
    throws java.sql.SQLException
    keys = new java.lang.Object[1];
    keys[0] = sqlj.runtime.ref.DefaultContext.getProfileKey(loader, "HelloWorld_SJProfile0");
    }

  • Need to create a sales order that does not create demand

    Hi,
    We need to create a no cost sales order - that does not create demand
    In our current set-up when we try to create a no cost sales order with a material ( It Cat = Norm) we see demand being created in MD04
    What configuration settings will allow us a deliverable order - that does not create demand (no MRP run?)
    Thanks,
    SM

    Hello,
    For this set of requirement i think the best option would be to configure a New Sales Order Type and a new Schedule Line Category. In VOV6, While you are defining a new Schedule line category in the transaction flow make sure to switch off the three check box.
    Transfer of requirements / Begin assembly order from SD
    Availability check for sales
    Product allocation active
    Then when we are assigning this newly defined Schedule line Category to Item category, make sure to leave the field of MRP Type as blank in VOV5.
    Regards,
    Sarthak

  • Imported Form and sub-form from another database. Sub-form not creating new records tied to parent form's data.

    I have imported all objects from an old access db (.adp file) into a new db (.accdb).  All of my data lives in sql server so I have added all the tables and views to the .accdb as linked tables.  My forms all connect to data, but I am having issues
    with a sub form.  The sub form does not allow for creation of children records tied to the parent record the way the old db did/does.
    Correct - old format .adp file (notice the empty second record in sub-form with the defaulted date of today's date):
    Incorrect - new .accdb file (notice the lack of empty second record in sub-form like above):
    If I click the create new record icon in the bottom of the subform, it creates a completely blank record not tied to the parent record (fields blacked out in screen shots above).  When using this button all parent record fields are blank.  
    I have also verified the child table used in the sub-form has a valid Fky relationship to parent table used in the parent form.
     

    Have you checked each forms 'Filter' property (in Design view) to make sure they are blank and that each forms 'Filter On Load' property to make sure it is set to 'No'? Also, you might try inserting the following commands in each forms On
    Open event:
    DoCmd.RunCommand acCmdRemoveAllFilters
    DoCmd.ShowAllRecords
    If you can open each forms Record Source and they are showing that new records are able to be entered (the new record * is showing at the bottom of the recordset), then check each forms On Load and On Open events to make sure there is no filtering.
    In addition, check any macro or VBA commands behind the button that opens the main form to make sure there is no SQL filtering in the DoCmd.OpenForm command.
    If one of the forms Record Source does NOT allow new records, then you will need to change that Record Source so the new record * indicator shows.
    Out of ideas at this point.

  • Firefox V30 will not create new tabs. OSX 10.9.3

    I am not able to open a new tab.
    The "+" on the right of the existing tab changes color when I click it but no new tab appears.
    Selecting Command "T" does not create a new tab.
    I can only get new tabs to appear by spawning these as an option within an existing page that opens new content in a new window.

    BTW - the updating of my Add Ons did NOT fix the problem.

  • Server does not create ois ?

    Hi folks !
    At first I wanted to send some Strings via the Client to the Server and print them onto the screen. On a specific String "antwort" I would like to send an Object k from the Server to the Client and prove on the Client the correctness of the object by reading the attribute set on the serverside before sending.
    But somehow the server does not create the ObjectInputStreams and I don�t know why.
    That�s the code:
    // Server:
    public class Server {
    public Server() {
    try{
    String input = new String();
    ServerSocket sock = new ServerSocket(16348);
    Socket socket = sock.accept();
    System.out.println("socket"); // this line is printed on connection
    ObjectInputStream sockin = new ObjectInputStream(socket.getInputStream());
    System.out.println("objectinputstream"); // but this one never appears
    ObjectOutputStream sockout = new ObjectOutputStream(socket.getOutputStream());
    Kunde k = new Kunde();
    k.setNummer(13);
    while(!input.equals("Ende")){
    input = sockin.readObject().toString();
    if(input.equals("antwort")){
    sockout.writeObject(k);
    sockout.flush();
    sockout.reset();
    System.out.println(input);
    socket.close();
    catch(Exception e){
    public static void main(String[] args) {
    // TODO code application logic here
    new Server();
    // The Client
    public class Client {
    public Client() {
    try{
    Socket sock = new Socket("localhost",16348);
    // System.out.println(sock.isOutputShutdown());
    sock.setSoTimeout(5000);
    System.out.println("socket hergestellt");
    ObjectInputStream sockin = new ObjectInputStream(sock.getInputStream());
    System.out.println("sockin");
    ObjectOutputStream sockout = new ObjectOutputStream(sock.getOutputStream());
    System.out.println("sockout");
    String eing = "";
    System.out.println("vor while");
    while(!eing.equals("close")){
    eing = erwarteEingabe();
    System.out.println("Sende:"+eing);
    if(eing.equals("antwort")){
    sockout.writeObject(eing);
    Kunde k = (Kunde)sockin.readObject();
    System.out.println("Nummer des Kunden: "+k.getNr());
    else{
    sockout.writeObject(eing);
    sockout.flush();
    sockout.reset();
    catch(Exception e){
    System.out.println(e);
    public static void main(String[] args) {
    // TODO code application logic here
    new Client();
    private String erwarteEingabe(){
    String eing = "";
    System.out.println("nehme Eing entgegen");
    try{
    BufferedReader b = new BufferedReader(new InputStreamReader(System.in));
    return b.readLine();
    catch(Exception e){
    System.out.println(e);
    return "";
    }

    When you create an ObjectInputStream it tries to read the object stream header from the underlaying stream. In this case both your server and client are waiting for the other one to send the header before they can continue. This problem can be avoided by simply creating the object output streams first:ObjectOutputStream sockout = new ObjectOutputStream(socket.getOutputStream());
    ObjectInputStream sockin = new ObjectInputStream(socket.getInputStream());

  • Oracle10g dbca does not create "create db" scripts!

    Hi All,
    Is this a new move in dbca world? What I have noticed is that dbca for 10g creates the template but does not create db creattion scripts under $ORACLE_BASE/{DB_NAME}/create.
    I think it was pretty useful when the system is limited in RAM and you don't want java interface taking 40% of RAM just to offer GUI front end -
    Is there anyway to create these scripts in 10g ?
    -Thanks,
    DP

    Yes,
    I can't find anything under $ORACLE_BASE/admin/{DB_NAME}/create
    OR
    $ORACLE_BASE/{DB_NAME}/create.
    In fact, I don't see any checkbox available under 10g version of dbca which allows to create/save the scripts - it still allows to store template as an html.
    -Thanks,
    VS

  • Save as does not Create PDF Compatible File even when the creare pdf compatible files is on, Illustrator CC 2014

    save as does not Create PDF Compatible File even when the creare pdf compatible files is on, Illustrator CC 2014

    When I open is adobe acrobat I get this message.
    "This is an Adobe® Illustrator® File that was
    saved without PDF Content.
    To Place or open this  le in other
    applications, it should be re-saved from
    Adobe Illustrator with the "Create PDF
    Compatible File" option turned on. This
    option is in the Illustrator Native Format
    Options dialog box, which appears when
    saving an Adobe Illustrator  le using the
    Save As command."

Maybe you are looking for

  • Iphotos and apple TV

    I am struggling getting my iphotos off of my iMAC to my Apple TV.  I understand that you need to go through Itunes...and I believe the problem may be in the name of the accounts.  We have one User ID for our Apple TV/iMac and another user id for Itun

  • Audio Rendering

    Hey Guys Im importing all my old videos through imovie using my vcr to camera to computer (since FCE needs a "timecode") when i bring in the video which can be up to 30+ minutes long is their anyway to turn off the audio rendering or still watch the

  • Visual Basic, DAO, Temp tables in stored procedures

    Client code currently uses DAO with SQLPassthrough option in VB to connect to SQl 6.5 db. I migrated all stored procedures with default options except Oracle 8i temp tables. For every procedure a package and a procedure was created. We use SQL server

  • Problem in replacing characters of a string ?

    Hello everybody, I want to replace a few characters with their corresponding unicode codepoint values. I have a userdefined method that gets the unicode codepoint value for a character. 1. I want to know how to replace the characters and have the rep

  • FM to Delete Position and Central person from org unit?

    Hi In SRM, we used tr-cd USERS_GEN to create position/CP using SU01 user. In transaction PPOMA_BBP we can see Org unit assigned to position(S) and Central person(CP). How to unassign or delete the Position and Central person from org unit? Can you pl