FileLock doesn't work in UNIX (solaris)

Hi all,
I have a piece of code which writes to xml file and before that locks the file to prevent two users writing in same file in same time.
This code works perfectly on my windows environment (Eclipse and windows 2000) but as soon as I put jar file in UNIX (SOLARIS) it doesn�t work and two clients can change at same time!
Anyone has an idea what is going on?
Note: I put sleep just to be able to make a delay so I can try to have access from second client session to test my lock
Following is my code:
  public synchronized void commitConfiguration() throws ConfigurationDataException
      try {     
          // Get a file channel for the file
          File file = new File(uri);
          FileOutputStream outputStream = new FileOutputStream(file);
          FileChannel  channel = outputStream.getChannel();
          FileLock lock = fileLock(channel);
          if(lock != null) {
              try {
                  processCommit(outputStream);
                  Thread.sleep(8000);
              }finally {
                  Thread.sleep(8000);
                  lock.release();
                  channel.close();
          //reload the configuration
          refreshConfiguration();                            
    } catch (Exception e1) {       
        throw new ConfigurationDataException("Cannot commit file, because: " + e1.getMessage());
  private static FileLock fileLock( FileChannel  channel) throws IOException {
      // Use the file channel to create a lock on the file. This is a share lock not exclusive so
      // other users can still read but not set
      // This method blocks until it can retrieve the lock.
      //FileLock lock = channel.lock(0L, Long.MAX_VALUE, true);
      // Try acquiring the lock without blocking. This method returns
      // null or throws an exception if the file is already locked.
      FileLock lock =null;
      try {
          lock = channel.tryLock();
      } catch (OverlappingFileLockException e) {
          // File is already locked in this thread or virtual machine
      if(lock == null) {
          lock = channel.lock();
      return lock;     
  }Thanks,

So what should we do to have the file locked?
The Issue is I have one shared file system which all
of my servers (it is a HA system which there are two
from each server) having access to same file and I
want them to be in synch, so I am trying to lock the
file so no body even from other JVM (second server)
cannot edit the file at the same time.
Is there any way to handle this issue with this
feature of java I mean FileLock and Channel API?Do the Java programs in the other servers also have the code to try and lock the file? Although unix has advisory locks, from what I have read, they should still work as long as you make sure all the Java programs that access the file attempt to get the lock. If any non-Java programs are using the file then they to would need to try and lock the file (not sure if they would play nice with the Java programs).

Similar Messages

  • FileLock Doesn't Work Across Network

    I have found a case in which FileLock doesn't work. I'm trying to use FileLock to prevent two instances of the same process to run simultaneously on different machines (or the same machine) on the network. I actually saw two processes, one on each of two Linux machines obtain a lock on the same file at the same time.
    Can I be sure that FileLock is calling fcntl and not flock (which wouldn't work over the network)?
    Is there any way to fix this or get around it??
    Here is the relevant code:
    try{
         File lockFile = new File(getLockFilename());
         lockFile.createNewFile();  // Throw out the boolean return value; it doesn't matter if this succeeded.
         FileChannel fc = new FileOutputStream(lockFile).getChannel();
         fileLock = fc.lock();
    catch (FileLockInterruptionException flie){
         // Allow this one.
    catch (IOException ioe){
            // Report the exception, release the lock if obtained and exit.
    // Code executed while the file is locked includes setting up and registering an RMI server object.
    try{
         fileLock.release();
    catch (IOException ioe){
         logger.warn("Unable to relase file lock:  " + ioe.getClass().getName() + ":  " + ioe.getMessage());
    }

    I suppose when you say "across network", you mean via
    nfs?Yes.
    Have each machine check some central point (or all
    other nodes) for the existence of a server. Of course
    there could be some synchronization problems, so you
    might check several times. Even if the remote
    interface is successfully exported, have it check one
    final time to ensure. To be paranoid, you could have
    it check often.We have a strong requirement not to have a central server, which has made coding this a headache. It would be pretty unacceptable to query every machine on our network (most of which probably aren't running any related process at any one time and are probably running other jobs) any time someone wants to start one of these processes on any machine. (There could be hundreds of these processes running at once with different parameters; it's just that no two with the same parameters are allowed to run at once. Each of these will act as a separate RMI server so other processes can communicate with the running process for other purposes besides just determining whether it is running.) A registry can only contain objects on one machine, right? Or can I somehow bind everything on the same host even though that's not where the objects are?? I am already writing the name of the successful host for one parameter set to a file and barring other processes with the same parameters from executing if looking up the process on that host succeeds. This works in most cases, but there is a race condition if two processes start around the same time and both read the file before either has written its host name there. That's why I'm trying to use a file lock on a different file so the read-bind-write sequence happens while the file is locked.

  • The Runtime.exec methods doesn't work well on Solaris ???

    I have two threads and I set the different running time.
    I use Runtime.exec to a run the command and use Process to get the process.
    It works properly in the windows2000 platform.
    However, when I transfer the platform to Solaris...and run the program...
    Two threads always at the same time....It is very wired....I always debug
    for 2 days....
    (at first I run "vmstat 1 2" command, later I change to "ls","rmdir"....etc,
    all of them don't work.....
    If I close the Runtime.exec..........Everything works well......)
    And I study the API. I found this message...
    The Runtime.exec methods may not work well for special processes on certain
    native platforms, such as native windowing processes, daemon processes,
    Win16/DOS processes on Win32, or shell scripts. The created subprocess does
    not have its own terminal or console.
    Could someone share her/his experience.....:(
    And if any other way I can run command inside java code instead of
    Runtime.exec.....???
    Please reply my mail to [email protected] I do appreciate your kindly &
    great help!!!!!!!!
    This is my code.......
    import java.io.*;
    import java.lang.*;
    import java.util.*;
    * <p>ServerThread1</p>
    * <p>??�X???��?�D???�X???, "Vmstat 1 2".</p>
    class ServerThread1 extends Thread{
    private ServerAgent Sa;
    public ServerThread1 (String Name, ServerAgent Sa){
    super(Name);
    this.Sa = Sa; file://Assign ServerAgent reference Sa
    public void run(){
    while(true){
    try{
    Thread.sleep(5000);
    catch (Exception e){
    System.out.println("ServerThread1 fails");
    System.out.println("Thread1 is running.");
    try {
    Runtime rt1 = Runtime.getRuntime();
    Process proc1 = rt1.exec("mkdir"); ------>If I close
    rt1.exec , two threads works seperately...........:(
    catch (Exception e) {
    System.out.println("Thread1 Error");
    class ServerThread2 extends Thread{
    private ServerAgent Sa;
    public ServerThread2 (String Name, ServerAgent Sa){
    super(Name);
    this.Sa = Sa;
    public void run(){
    while(true){
    try{
    Thread.sleep(15000);
    catch (Exception e){
    System.out.println("ServerThread2 fails");
    System.out.println("Thread2 is running.");
    try {
    Runtime rt2 = Runtime.getRuntime();
    Process proc2 = rt2.exec("vmstat 1 2"); ----->If I don't run
    the rt2.exe, two threads work seperately....
    catch (Exception e) {
    System.out.println("Thread2 Error");
    public class ServerAgent{
    private Vector v1 = new Vector();
    private Vector v2 = new Vector();
    private Hashtable currentData = new Hashtable();
    private static String startUpSwap = null;
    private static String startUpMem = null;
    public static void main(String[] arg) {
    ServerAgent s = new ServerAgent();
    ServerThread1 st1 = new ServerThread1("Thread1",s);
    ServerThread2 st2 = new ServerThread2("Thread2",s);
    st1.start();
    st2.start();

    If I close the Runtime.exec..........Everything works
    well......)You don't empty the output of the command, that blocks the process.
    A citation from
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
    Why Runtime.exec() hangs
    The JDK's Javadoc documentation provides the answer to this question:
    Because some native platforms only provide limited buffer size for standard input and output streams, failure to promptly write the input stream or read the output stream of the subprocess may cause the subprocess to block, and even deadlock.
    Try out something like this:
    String s;
    try {
       Process myProcess =
       Runtime.getRuntime().exec("ls -l"));
       DataInputStream in = new DataInputStream(
              new BufferedInputStream(myProcess.getInputStream()));
        while ((s = in.readLine()) != null) {
            out.println(s);
    catch (IOException e) {
        out.println("Error: " + e);
    }Another source of trouble under Unix is not having the correct permission for that user that executes the Java VM, which will be the permissions for the spawned subprocess. But this probably not the case, as you see something after exit.
    Regards,
    Marc

  • SMC doesn't work in any solaris 10 whole-root zones

    All
    Are you aware of SUN not designing whole-root zones to work with Solaris Management Console?
    None of my solaris 10 whole-root zones/containers will run Solaris Management Console. Very, very frustrating!
    Anyone have a trick to get around this crazy design??
    Thank you!
    SB

    Thanks for your help!
    Yes, i see all font types.
    But maybe i havn't explained my problem good enough:
    I have a FLA-File which works great in Flash CS3: everything – even on different computers – is okay!
    The same FLA-File on the same computer in Flash CS6: the font-rendering is broken!
    In CS6 there seems to be a difference between textfields made via ActionScript and textfields on the stage: see the attached file in my first post.

  • Anyone know when the 'Patch' or 'service pack' will be released for UDS 5?  It doesn't work correctly on Solaris systems.

    When trying to export code from older versions of forte and import the code into UDS 5, the imports don't work correctly on Sun server, Solaris system. Errors in the Windows. Seems to be a common problem, but haven't heard of any patch yet.

    The SP1 for UDS 5 or 5.0.3 will be out in 2-3 weeks. I already have a beta copy of SP1 so I am sure you can request this if you open a case on your problem. I have never ran into the problem you are describing.
    ka

  • "format" command doesn't work after installing Solaris 10 (5/4/06) Patch

    After I installed the latest Solaris 10 patch, it doesn't allow me to format my other disks on the system.
    Here is the error message:
    [host1]# format
    Searching for disks...done
    AVAILABLE DISK SELECTIONS:
    0. c1t0d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
    /pci@7c0/pci@0/pci@1/pci@0,2/LSILogic,sas@2/sd@0,0
    1. c1t1d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
    /pci@7c0/pci@0/pci@1/pci@0,2/LSILogic,sas@2/sd@1,0
    Specify disk (enter its number): 0
    selecting c1t0d0
    [disk formatted]
    Warning: Current Disk has mounted partitions.
    ld.so.1: format: fatal: relocation error: file /usr/sbin/format: symbol dm_get_slices: referenced symbol not found
    Killed
    [host1]#
    If anyone knows how to fix this bug, please kindly reply.

    You need to apply the patch: 122176

  • Tile/cascade windows doesn't work in Unix Reader

    I'm running Reader 9.4.7 on Ubuntu 10.04 amd64. There are menu items on the Reader Window menu to cascade windows or tile them vertically or horizontally, but nothing happens when I select these menu items - I can still only see one of the tabbed open documents at a time. The same menu items work fine in the Windows version of Reader. Were the Adobe programmers just too lazy to either remove them or implement the code behind them when building the Unix version?
    The only way to view two PDFs is to detach the tab for one of them into a completely separate window. That sort of works, but a fair bit of screen space is lost through having two separate Reader windows open, each with a tab, menu bar, and toolbar.

    Not especially, I just like to be up to date with things. Whilst aware of that saying, I don't subscribe to it. I have RSS feeds for various apps and drivers so I knwo when there are new versions of them.
    The card has a limitation which I think could be worked around with a driver change that to me, as an outsider, seems like it could be relatively simple. But, obviously it might not be, and there could be technical reasons this isn't done rather than an oversight. But I'd just like to keep up to date in case any changes on this front ever happen.
    http ://*****s.creative.com/t5/Sound-Blaster/Why-is-the-encoder-setting-not-per-mode/td-p/57657

  • Solaris 10 JumpStart server doesn't works correctly with Solaris Express

    Hi All,
    I have configured the JumpStart server on Solaris 10.
    I install Solaris 10 and Solaris 9 also using flash installation.
    When I run installation installer ask me 2 or 3 questions (I don't exactly remember) about NFS and then it install automatically.
    Does anybody know how to avoid these few questions at the beginning of installation?
    Thanks,
    Daniel

    The first question is:
    �� The Solaris Installation Program ������������������������������
    The Solaris installation program is divided into a series of short sections
    where you'll be prompted to provide information for the installation. At
    the end of each section, you'll be able to change the selections you've
    made before continuing.
    About navigation...
    - The mouse cannot be used
    - If your keyboard does not have function keys, or they do not
    respond, press ESC; the legend at the bottom of the screen
    will change to show the ESC keys to use for navigation.
    ����������������������������������������������������������������
    F2_Continue F6_Help
    Then I select to Continue:
    �� Identify This System ����������������������
    On the next screens, you must identify this system as networked or
    non-networked, and set the default time zone and date/time.
    If this system is networked, the software will try to find the information
    it needs to identify your system; you will be prompted to supply any
    information it cannot find.
    > To begin identifying this system, press F2.
    ����������������������������������������������������������������
    Esc-2_Continue Esc-6_Help
    Then I select to continue:
    �� NFSv4 Domain Name ����������������������������
    NFS version 4 uses a domain name that is automatically derived from the system's naming services. The derived domain name is sufficient for most configurations. In a few cases, mounts that cross domain boundaries might cause files to appear to be owned by "nobody" due to the lack of a common domain name.
    The current NFSv4 default domain is: ""
    NFSv4 Domain Configuration
    ���������������������������������������������������������������� [X] Use the NFSv4 domain derived by the system
    [ ] Specify a different NFSv4 domain
    ������������������������������������������������������
    Esc-2_Continue Esc-6_Help
    I select continue:
    �� Confirm Information for NFSv4 Domain ������������������
    > Confirm the following information. If it is correct, press F2;
    to change any information, press F4.
    NFSv4 Domain Name: << Value to be derived dynamically >>
    ������������������������������������������������������
    Esc-2_Continue Esc-4_Change Esc-6_Help
    Again I select continue and then the Solaris Express installs automatically.

  • File comparaison works on win32, not on unix solaris

    Hi all!
    I have the following code comparing 2 files. It works on win2000 but doesnt work on unix solaris.
         private boolean fichierIdentiqueBytePourByte( InputStream in1, InputStream in2 ) throws IOException{
              int a = 0, b = 0;
              while(true){
                // read next byte from both stream
                a = in1.read();
                b = in2.read();
                // if its different then files are different and we are done
                if (a!=b) return false;
                // if both are at eof then all checked must be the same
                if (a==-1&&b==-1) return true;
                // if either are at eof then they are different sizes
                if (a==-1||b==-1) return false;
         }any ideas of what the problem might be?
    Thanks

    418nic wrote:
    Hi all!
    I have the following code comparing 2 files. It works on win2000 but doesnt work on unix solaris.
         private boolean fichierIdentiqueBytePourByte( InputStream in1, InputStream in2 ) throws IOException{
              int a = 0, b = 0;
              while(true){
    // read next byte from both stream
    a = in1.read();
    b = in2.read();
    // if its different then files are different and we are done
    if (a!=b) return false;
    // if both are at eof then all checked must be the same
    if (a==-1&&b==-1) return true;
    // if either are at eof then they are different sizes
    if (a==-1||b==-1) return false;
         }any ideas of what the problem might be?
    ThanksWell, from your code, you only have two traits that this depends on to work--comparing int's and EOF. You have hard coded a -1 for EOF into this, I am not completely familiar with EOF condition on different platforms, but I know int's compare without error on every platform. Do a debug and a breakpoint set to stop just before you think you're going to get an EOF and I think you'll see, that the EOF you are using is the actual problem.

  • View works in Solaris in 1 minute but doesn't work in WIn2003

    We have a view is badly written. Other than the non-searchable conditions like '%*%'. What else is wrong:
    CREATE OR REPLACE FUNCTION anycon_p(neid NUMBER, joinaid VARCHAR2, sdf NUMBER, nodetype NUMBER ) RETURN N
    UMBER IS
    fromid NUMBER :=0;
    BEGIN
    if (nodeType=302 or nodetype = 303 )then
    select count(1) into fromid from JS_CM_TP tp where (tp.ne_id=neid)
    and (tp.tp_joinaid = joinaid) and (tp.tp_sdf = sdf) and (tp.crs_emlkey is not null);
    elsif (nodeType=307)then
    select count(1) into fromid from JS_CM_TP tp where (tp.ne_id=neid)
    and (tp.tp_joinaid = joinaid)and (tp.tp_sdf <= sdf)
    and (tp.tp_sdf+2 >= sdf)and(tp.crs_emlkey is not null);
    elsif (nodeType=308)then
    select count(1) into fromid from JS_CM_TP tp where (tp.ne_id=neid)
    and (tp.tp_joinaid = joinaid) and (tp.tp_sdf <= sdf)
    and (tp.tp_sdf+11 >= sdf)and(tp.crs_emlkey is not null);
    end if;
    RETURN fromid;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    RETURN 0;
    END;
    CREATE OR REPLACE VIEW JS_QUERY_FAC_AVAIL_VW AS
    SELECT
    tp.NE_ID NE_ID,
    ne.NE_NAME NE_NAME,
    tp.SHELFAID shelfaid,
    c.CARD_TYPE cardtype,
    tp.TP_AID tpaid,
    tp.TP_TPTYPE tptype,
    tp.TP_RAWPST tppst,
    tp.TP_JOINAID pmaid,
    c.CARD_RAWPST cardpst,
    tp.TP_TACCID tacc,
    CASE
    WHEN c.CARD_RAWPST LIKE '%OOS%' THEN 'PM-OOS'
    WHEN tp.TP_RAWPST LIKE '%OOS%' THEN 'FAC-OOS'
    WHEN (tp.TP_LPBKCMD IS NOT NULL) AND (tp.TP_LPBKCMD NOT LIKE '%NONE%') THEN 'FAC-LPBK'
    ELSE 'IS-NOT CONNECTED'
    END AS reason,
    tp.TP_FACTYPE AS factype
    FROM
    JS_NM_NE ne,
    JS_CM_CARD c,
    JS_CM_TP tp
    WHERE
    ne.NE_ID = c.NE_ID
    AND c.NE_ID = tp.NE_ID
    AND tp.TP_JOINAID = c.CARD_AID
    AND c.CARD_RAWPST NOT LIKE '%UEQ%'
    AND (tp.TP_DV_NODETYPE='300')
    AND (tp.TP_TPTYPE ='DGR')
    AND (tp.TP_RAWPST LIKE '%OOS%'
    OR c.CARD_RAWPST LIKE '%OOS%'
    OR (tp.TP_LPBKCMD IS NOT NULL AND tp.TP_LPBKCMD NOT LIKE '%NONE%')
    OR tp.CRS_EMLKEY is null)
    AND (tp.TP_TACCID IS NULL OR tp.TP_TACCID LIKE '%0%')
    UNION ALL
    SELECT
    tp.NE_ID NE_ID,
    ne.NE_NAME NE_NAME,
    tp.SHELFAID shelfaid,
    c.CARD_TYPE cardtype,
    tp.TP_AID tpaid,
    tp.TP_TPTYPE tptype,
    tp.TP_RAWPST tppst,
    tp.TP_JOINAID pmaid,
    c.CARD_RAWPST cardpst,
    tp.TP_TACCID tacc,
    CASE
    WHEN c.CARD_RAWPST LIKE '%OOS%' THEN 'PM-OOS'
    WHEN tp.TP_RAWPST LIKE '%OOS%' THEN 'FAC-OOS'
    WHEN (tp.TP_LPBKCMD IS NOT NULL) AND (tp.TP_LPBKCMD NOT LIKE '%NONE%') THEN 'FAC-LPBK'
    ELSE 'IS-NOT CONNECTED'
    END AS reason,
    tp.TP_FACTYPE AS factype
    FROM
    JS_NM_NE ne,
    JS_CM_CARD c,
    JS_CM_TP tp
    WHERE
    ne.NE_ID = c.NE_ID
    AND c.NE_ID = tp.NE_ID
    AND tp.TP_JOINAID = c.CARD_AID
    AND c.CARD_RAWPST NOT LIKE '%UEQ%'
    AND ((tp.TP_DV_NODETYPE='302' AND tp.tp_tptype='DGR'
    AND((tp.tp_rawpst NOT LIKE '%UAS%') OR(tp.tp_joinaid NOT LIKE 'EPMX24%')))
    OR(tp.TP_DV_NODETYPE='303' AND((tp.tp_rawpst NOT LIKE '%UAS%') OR
    (NOT EXISTS ( select null from JS_CM_TP tp1
    where (tp1.ne_id = tp.NE_ID)
    where (tp1.ne_id = tp.NE_ID)
    and (tp1.tp_sdf = tp.tp_sdf)
    and (tp1.tp_dv_nodetype = '302')
    and (tp1.tp_rawpst not like '%UAS') )))))
    AND (tp.TP_RAWPST LIKE '%OOS%'
    OR c.CARD_RAWPST LIKE '%OOS%'
    OR (tp.TP_LPBKCMD IS NOT NULL AND tp.TP_LPBKCMD NOT LIKE '%NONE%')
    OR (NOT EXISTS ( select null from JS_CM_TP tp1
    where (tp1.ne_id = tp.NE_ID)
    and (tp1.tp_joinaid = tp.tp_joinaid)
    and (tp1.tp_sdf = tp.tp_sdf)
    and (tp1.crs_emlkey is not null) ) ) )
    AND (tp.TP_TACCID IS NULL OR tp.TP_TACCID LIKE '%0%')
    UNION ALL
    SELECT
    tp.NE_ID NE_ID,
    ne.NE_NAME NE_NAME,
    tp.SHELFAID shelfaid,
    c.CARD_TYPE cardtype,
    tp.TP_AID tpaid,
    tp.TP_TPTYPE tptype,
    tp.TP_RAWPST tppst,
    tp.TP_JOINAID pmaid,
    c.CARD_RAWPST cardpst,
    tp.TP_TACCID tacc,
    CASE
    WHEN c.CARD_RAWPST LIKE '%OOS%' THEN 'PM-OOS'
    WHEN tp.TP_RAWPST LIKE '%OOS%' THEN 'FAC-OOS'
    WHEN (tp.TP_LPBKCMD IS NOT NULL) AND (tp.TP_LPBKCMD NOT LIKE '%NONE%') THEN 'FAC-LPBK'
    ELSE 'IS-NOT CONNECTED'
    END AS reason,
    tp.TP_FACTYPE AS factype
    FROM
    JS_NM_NE ne,
    JS_CM_CARD c,
    JS_CM_TP tp
    WHERE
    ne.NE_ID = c.NE_ID
    AND c.NE_ID = tp.NE_ID
    AND tp.TP_JOINAID = c.CARD_AID
    AND c.CARD_RAWPST NOT LIKE '%UEQ%'
    AND tp.TP_DV_NODETYPE IN ('307')
    AND (tp.tp_aid not like '%-P-%')
    AND (tp.TP_TACCID IS NULL OR tp.TP_TACCID LIKE '%0%')
    AND (tp.TP_RAWPST LIKE '%OOS%'
    OR c.CARD_RAWPST LIKE '%OOS%'
    OR (tp.TP_LPBKCMD IS NOT NULL AND tp.TP_LPBKCMD NOT LIKE '%NONE%')
    OR (NOT EXISTS (select null from JS_CM_TP tp1
    where (tp1.ne_id = tp.NE_ID)
    and (tp1.tp_joinaid = tp.tp_joinaid)
    and (tp1.tp_sdf <= tp.tp_sdf)
    and (tp1.tp_sdf >= tp.tp_sdf-2)
    and (tp1.crs_emlkey is not null) ) ) )
    UNION ALL
    SELECT
    tp.NE_ID NE_ID,
    ne.NE_NAME NE_NAME,
    tp.SHELFAID shelfaid, c.CARD_TYPE cardtype,
    tp.TP_AID tpaid,
    tp.TP_TPTYPE tptype,
    tp.TP_RAWPST tppst,
    tp.TP_JOINAID pmaid,
    c.CARD_RAWPST cardpst,
    tp.TP_TACCID tacc,
    CASE
    WHEN c.CARD_RAWPST LIKE '%OOS%' THEN 'PM-OOS'
    WHEN tp.TP_RAWPST LIKE '%OOS%' THEN 'FAC-OOS'
    WHEN (tp.TP_LPBKCMD IS NOT NULL) AND (tp.TP_LPBKCMD NOT LIKE '%NONE%') THEN 'FAC-LPBK'
    ELSE 'IS-NOT CONNECTED'
    END AS reason,
    tp.TP_FACTYPE AS factype
    FROM
    JS_NM_NE ne,
    JS_CM_CARD c,
    JS_CM_TP tp
    WHERE
    ne.NE_ID = c.NE_ID
    AND c.NE_ID = tp.NE_ID
    AND tp.TP_JOINAID = c.CARD_AID
    AND c.CARD_RAWPST NOT LIKE '%UEQ%'
    AND tp.TP_DV_NODETYPE = '308'
    AND (tp.tp_aid not like '%-P-%')
    AND (tp.TP_TACCID IS NULL OR tp.TP_TACCID LIKE '%0%')
    AND (tp.TP_RAWPST LIKE '%OOS%'
    OR c.CARD_RAWPST LIKE '%OOS%'
    OR (tp.TP_LPBKCMD IS NOT NULL AND tp.TP_LPBKCMD NOT LIKE '%NONE%')
    OR (NOT EXISTS (select null from JS_CM_TP tp1
    where (tp1.ne_id = tp.ne_id)
    and (tp1.tp_joinaid = tp.tp_joinaid)
    and (tp1.tp_sdf <= tp.tp_sdf)
    and (tp1.tp_sdf >= tp.tp_sdf-11)
    and (tp1.crs_emlkey is not null) ) ) )
    WITH READ ONLY;

    If you think anybody's going to be able to point out flaws in that code you're mistaken. Well, maybe somebody with time on their hands will go through it but I doubt it.
    But given your subject the real point of enquiry ought to be, what is the difference between your Solaris set up and your Windows environment? And what do you mean by
    doesn't work in WIn2003please describe observed behaviour, including error messages if appropriate.
    Cheers, APC

  • Unix Command doesn't work in Tiger

    Hi,
    I've got labs of eMacs that I'm finally upgrading to Tiger. My image seems to work fine, but I'm running into a weird quirk with my "Send Unix" commands via ARD. We're doing NWEA testing and LOVE the unix commands because we can login to machines, turn on TestTaker, login to TestTaker, and select the correct test (math or reading) and the right version of the test.
    The script below works fine on a panther eMac.
    osascript
    tell application "System Events"
    keystroke "1" using command down
    delay 3.0
    keystroke ASCII character 31
    delay 2.0
    keystroke return
    keystroke "n" using command down
    end tell
    On my Tiger machines, the command stops on the:
    "Keystroke ASCII character 31" line (this should arrow down to next test version).
    A report window comes up in ARD with this error message:
    86:104: execution error: System Events got an error: 31 doesn't understand the ASCII character message. (-1708)
    This used to work perfectly, but now I can't get ASCII 31 (or arrow down to work). The real killer is that other techs in my school district have eMacs running tiger with same commands that work (some have to arrow down 16 times to get to correct test version). The other commands (like command 1 and returns, command n) all work fine! Hate to have to touch 80 machines each day to select proper test version when we log in.
    Any Suggestions????

    Try this form of the line:
    keystroke (ASCII character of 31)
    That's worked for some people. Hope it works for you. If it doesn't work as given, try without the parentheses.
    Regards.

  • The mouse scroll wheel doesn't work with Xorg

    I recently installed Solaris 10 on my x86 box. One issue is that the mouse scroll wheel doesn't work with Xorg. Hmmm... Okay, it sometimes did work, and most of the time went on strike, and recovered at random. This pattern continued.
    My mouse is an ordinary PS/2 one with two buttons and a scroll wheel. I want to promise that there's absolutely nothing wrong with it per se. Here is some info:
    $ uname -a
    SunOS arbiter 5.10 Generic_127112-07 i86pc i386 i86pc
    $ grep -i mouse /var/log/Xorg.0.log
    (**) |-->Input Device "Mouse0"
    (II) LoadModule: "mouse"
    (II) Loading /usr/X11/lib/modules/input//mouse_drv.so
    (II) Module mouse: vendor="X.Org Foundation"
    (==) NVIDIA(0): Silken mouse disabled
    (II) Mouse0: Setting Device option to "/dev/mouse"
    (**) Mouse0: Protocol: VUID
    (**) Mouse0: Core Pointer
    (**) Option "Device" "/dev/mouse"
    (**) Mouse0: ZAxisMapping: buttons 4 and 5
    (**) Mouse0: Buttons: 9
    (II) XINPUT: Adding extended input device "Mouse0" (type: MOUSE)
    # The section about mouse in /etc/X11/xorg.conf follows:
    Section "InputDevice"
            Identifier  "Mouse0"
            Driver      "mouse"
            Option      "Protocol" "auto"
            Option      "Device" "/dev/mouse"
            Option      "Buttons" "5"
            Option      "ZAxisMapping" "4 5"
            Option      "Emulate3Buttons" "false"
    EndSection
    # Note that the only result of explicitly changing protocol to ExplorerPS/2, PS/2, IMPS/2 or whatever else is that the cursor jumped here and there and everywhere when I moved the mouse.I ever post one in comp.unix.solaris to ask for help but got no effective solution. Thank you all.

    You remember correctly, Yvan.
    The 6.2.9 updater is available http://www.apple.com/support/downloads/appleworks629formac.htmlhere. Note that the updater is language specific. The one at the top of the list is for the International English version of AppleWorks. The US English version is the one in the box at the upper right, identified only by its file size.
    Regards,
    Barry

  • [SOLVED]Custom DSDT not loading - OEM battery doesn't work - Sony Vaio

    EDITING ORIGINAL POST TO POST SOLUTION so I don't do a massive bump
    Installed windows and ran the BIOS flasher that came with the battery. Didn't work until I changed a line in the plaintext configuration file (config.ini or something) it comes with. Changed "Capacity: 20" to "Capacity: -10". This changed the battery charge requirement from 20% to negative ten percent (any negative number will do), allowing the program to run and flash the BIOS. Didn't realize I could do that, but it fixed  the problem 100%.
    #### BEGIN ORIGINAL POST: ################################
    Hey guys,
    I'm a bit of a linux noob, but I've spent many hours this week trying to fix this issue on my own and have learned a lot about making custom kernels, hardware stuff, ACPI, and ABS. However, nothing I've done has worked and I've hit a wall. For reference, I'm on a Sony Vaio VGN-FZ4000 with linux-3.0 base kernel, gnome3/gdm. The battery is made in china and doesn't list a manufacturer, just model number BPS8, 52000mAh.
    [Backstory]
    So I recently got an OEM battery to replace the broken original, which hasn't worked since before I installed arch (though it worked with an Arch install I did a couple years ago). When I first plugged it in, the gnome battery symbol popped up listing the battery at 0% with an exclamation icon. I unplugged from AC power and the laptop still ran, but the battery monitor just said it was at 0% and 'Estimating' remaining time. I figured this was a glitch with gnome or just because it was this battery's first cycle so I let it run down until it hard-crashed. Then I plugged back into AC and tried to turn on the computer, but it wouldn't do anything until I removed the battery.
    Looking into the problem I discovered this was due to the ACPI firmware table DSDT being compiled for Windows, which has, shall we say, fewer restrictions on sanity than the Intel ASL compiler used for UNIX systems. Sure enough I extracted /sys/firmware/acpi/tables/DSDT to find that its section about the battery contained the entry 'Zero' for Battery Technology, which translates to "non-rechargeable", rather than 'One', which makes it chargeable. acpitool confirmed this; my system thought the battery was non-rechargeable and was constantly discharging it. Needless to say I've only been putting it in temporarily to test solutions since.
    [/backstory]
    [tl;dr] DSDT firmware contains malformed battery description, now I can't get my system to run with a custom DSDT. [/tl;dr]
    Attempted solutions:
    [1]
    Extract, modify, recompile DSDT and include it with the kernel compilation .config options
    CONIFG_ACPI_CUSTOM_DSDT=y
    CONFIG_ACPI_CUSTOM_DSDT_FILE="/usr/src/custom_dsdt.hex
    CONIFG_STANDALONE=n
    as suggested here, a page linked to by the arch wiki page on DSDT.
    I followed the instructions but no matter what this has generated errors during the kernel compilation, sometimes due to every line containing unexpected \231 (or other numbers) characters, sometimes finding some error in the DSDT file and then claiming that the driver it was compiling (ol.c somewhere in the drivers/acpi section I believe) had references to undefined functions all over the place. I CANNOT compile with a custom DSDT specified.
    [2]
    Place recompiled DSDT in /lib/initcpio/custom.dsdt and add 'dsdt' to the HOOKS in mkinitcpio (and rebuild the initramfs-linux-*.img, of course). Another version of this included recompiling the kernel with CONFIG_STANDALONE disabled.
    In neither of these situations has the running DSDT ever been anything but the BIOS-supplied one and not once has the battery shown any different behavior.
    acpitool and $ cat /proc/acpi/battery/BAT0/info have consistently claimed the information specified in the BIOS-supplied DSDT; the battery is non-rechargeable and is discharging at an unknown rate. Sometimes acpi will even report that the battery has zero capacity.
    The arch wiki does say mkinitcpio doesn't support the dsdt hook as of 2.6.30, but [1] didn't work either and mkinitcpio -H dsdt still told me to try this so I did.
    [3]
    The final solution I have tried has been to do [2] but to recompile the kernel with the legacy support for battery and ac adapter stuff disabled. I tried this because it was suggested in the kernel.log;
    Sep  13 11:51:03 localhost kernel: [   11.740059] ACPI: Deprecated procfs I/F for AC is loaded, please retry with CONFIG_ACPI_PROCFS_POWER cleared
    Sep  13 11:51:03 localhost kernel: [   11.753434] ACPI: AC Adapter [ADP1] (on-line)
    The corresponding line now reads
    ACPI: AC Adapter [ADP1] (on-line)
    (The same goes for the battery BAT0)
    but all this does is remove the battery/ and adp1/ folders from /proc/acpi/ and break acpitool functionality. The log still doesn't mention the dsdt hook, either.
    [4]
    The old way to do this was to use the acpi-dsdt-initrd-patch-* patch, but that hasn't been updated for modern kernels, presumably because of the new "functionality" from mkiniticpio. The current kernel .config doesn't include any options for ACPI initrd/initramfs support or reading a DSDT from initramfs, which is the functionality provided by this patch.
    This covers all the methods I've been able to find on the internet and I'm at a loss for what to do. Am I doing something wrong in [1]? Under what conditions will the compiler fail/succeed with a CONFIG_ACPI_CUSTOM_DSDT_FILE?
    When I recompile I fix the 'Zero' definition and a couple compiler errors and warnings. The errors come from section length definitions, which read as 0x00000000 rather than the appropriate max-min value so I fix those, and the warnings come from _T_* methods belonging to the compiler, so I refactor the code to remove the initial underscores. The last warning comes from an isolated And statement that's within brackets (compiler complains it doesn't do anything), but if I remove that the compiler fails hard.
    Thanks to anyone who's read this far.  Please let me know if you have any ideas how to get my system to use a customized DSDT.
    Last edited by paraffin (2011-09-29 23:20:30)

    Thanks for the offer, Radioactive man However, I'm actually compiling a customized kernel with the linux-ck and -sony patches, so your packages won't help. (The custom kernel works fine and I've tested this battery behavior on the the regular, -ck, and -sony kernels as well)
    Anyway, so I tried another compile with
    CONFIG_PREVENT_FIRMWARE_BUILD=n in addition to the options listed in [1] and that time it compiled.
    Unfortunately it still didn't load the DSDT!
    I did catch a quick little error message that turned up in kernel.log though;
    /var/log/kernel.log:Sep 15 11:50:24 localhost kernel: [    0.925780] acerhdf: unknown (unsupported) BIOS version Sony Corporation/VGN-FZ4000E/R2110J7, please report, aborting!
    acerhdf is a fan controller module for the Aspire One, and perhaps I left that in the kernel config and it's preventing the custom DSDT from loading, even though the acerhdf module never gets loaded itself, nor is it in my rc.conf or anything else... If that was the cause of all this, I'm gonna be angry...
    Anyway, this message does not appear with my latest kernel build because I took off the custom DSDT option, hoping to be able to use ACPI_CUSTOM_METHOD=y, which supposedly allows one to inject a custom AML method into a debug fs. It wouldn't have worked anyway, as it doesn't let you modify Device sections, but even with a dummy method insertion it didn't give my root modification privileges as it was supposed to...
    Will try recompiling AGAIN with this CONFIG_ACERHDF=n (it's simply 'not set' in my current .config), while also enabling the custom kernel etc. If this doesn't work I have no idea what I'll do.
    Anyway, thanks for your help and time:

  • [Solved] xmodmap bug? Remapping Caps Lock doesn't work

    When I program I like to swap these keys:
    Esc <-> Tab
    Ctrl <-> Caps Lock
    In ~/.xmodmap, I have specified these re-mappings:
    keycode 66 = Control_L
    keycode 37 = Caps_Lock
    keycode 23 = Escape
    keycode 9 = Tab
    The Escape and Tab keys swaps, no problem, but instead of Caps_Lock and Control_L swapping, both those keys becomes Caps_Lock.
    Whatever I try to do, the Control keys doesn't get assigned to Caps_Lock(keycode 66). If I leave the keycode 66 = , the key is un-assigned, but when I assign Control_L or Control_R, it just doesn't work. But, if I assign some other key, for example, keycode 66 = Tab, it gets assigned, no problem.
    Its like xmodmap just doesn't want Caps Lock and Control keys to be swapped. Really frustrating. Any help/pointers would be really helpful.
    Last edited by Gits (2012-04-12 07:09:37)

    Solved: http://unix.stackexchange.com/questions … oesnt-work

  • How to install owb server-side software on UNIX Solaris (SPACR-64)?

    Hi there,
    How to install owb server-side software on UNIX Solaris (SPACR-64)?
    I've read the install guide
    and it mentions
    3. Start the installer by entering the following at the prompt:
    cd mount_point
    ./runInstaller
    I don't have access to any graphical interface on the UNIX box e.g. x-windows nor any cd with the software, just the solaris software downloaded from web - does this include the runinstaller
    and is the runisnatller just a command line interface?
    I hoped I would be able to download the software from oracle website and then simply run the a setup scrip?
    Is it possible to do this? Would I simply substitute cd mount_point to cd <directory I put software)
    I've never ran oracle universall installer on UNIX before.
    Many Thanks
    Edited by: user575470 on Feb 15, 2009 7:54 AM
    Edited by: user575470 on Feb 15, 2009 8:06 AM

    Hi,
    You can install the server-side software from the downloaded software.
    You don't need the CD
    You do need an X-windows client on your computer to connect to the server OR work directly on the server.
    Without X-windows you cannot start the Oracle Universal Installer.
    Maybe there is a command line installation, I have never used this.
    I hope this helps.
    Regards,
    Emile

Maybe you are looking for

  • How do I update my plug-ins, as prompted?

    In installing Foxfire for the first time, I was prompted to update my plug-ins. When I click on "update," I get a window asking if I want to save this file. I click to save, then I get the original screen with the same plug-in and others still listed

  • I need a program! I'll pay you!

    Hi! I have to create a java program but I'm in difficult and I have no very experience with Java. The program is the following: Create a Client POP3 that is able to list messages, that are on the Server POP3, without have to download them. Users must

  • One button to flatten and email

    Is it possible to make a button programmed to email and flatten a fillable acrobat form?  The form will be used for reader mostly. 

  • Mail is putting multiple copies of sent emails in my drafts folder, or in trash.

    Mail is putting copies of emails successfully sent in my drafts folder, sometimes multiple copies, sometimes in trash. Also, new email keeps entering my inbox after I've moved it to other mailboxes or to the trash or junk mail. Also, if I search for

  • IPhone 5 16 bg replacement price

    i dropped it in water, tried the rice, isnt working, i need it replaced, how much? $