Java Thread.sleep(timeout) is influenced by changes to System time on Linux

Java Thread.sleep(timeout) is influenced by changes to System time on Linux
bugId : 6311057
I encountered this problem in redhat6/ jdk 1.6

890651 wrote:
Java Thread.sleep(timeout) is influenced by changes to System time on Linux
bugId : 6311057
I encountered this problem in redhat6/ jdk 1.6At least half the time I use it, I'd want it to be, the other half I wouldn't care.
What are you doing with it where this might be a problem?
Changing the system clock abruptly can cause all kinds of problems with your system anyway, because various background activities etc. often depend on file dates. Wherever possible use the "skew" method to adjust your system clock, rather than just plonking in a new value, especially if you are setting the clock backwards.

Similar Messages

  • Under CentOS 6 x64, Java Thread.sleep()/Object.wait() will be influenced.

    Under CentOS 6 x64, Java Thread.sleep()/Object.wait() will be influenced while changing OS time.
    I found a BUG in java bug list. The bug id is 6311057 with fixed status. But I find it still existing.
    Under CentOS6 x64 platform, on JDK1.6.0_33, the bug still exists.
    But under CentOS5 x64 platform, on same JDK, the problem does not exist.
    Could anyone give me help? Thanks.
    The bug's link is http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6311057
    Edited by: user10222290 on 2012-6-13 下午9:22

    user10222290 wrote:
    One server could want to synchronize it's OS time with another server when they connected each other for some business reasons. I have 3 computers running pretty much continuously with time synchronised from one of the internet time servers. They never seem to be more than about 1/10 th second apart and any time corrections are very very small.
    Some threads have started to run before changing OS time, so these thread's sleep process will be influenced sometime seriously.I understand that but I would only expect this to be a problem when there is a significant change to the OS time. If each server is synchronized to a time server then the time corrections will be very very small.
    If OS time was turned back some days, these thread could not wake up untill some days passed.Agreed but why would the "OS time be turned back some days" ?
    This whole problem seems to me to arise because the servers are not time synchronized. Now I understand that there may be concerns about the security of external time servers but it is easy enough to make one of the local servers a master and act as a time server to the others.
    I have a small server that typically services some 30 or so external clients. I don't have any control over the clients and do not know anything about the setting of their system clocks. The clients send a time signal as part of a heartbeat and from this the server keeps track of the local time on each client and compensates for any difference when writing logs. I have seen this difference as big as 4 months but the compensation corrects it to within about a second. No adjustment of clocks is required for this.
    I still don't see this 'bug' as a serious bug. I just see a design problem to be solved without changing the OS time on any computer. I know this can be done since I do it. The only problem I see is if you want an accuracy of better than about 20 mS but that does not seem to be required for your system.
    Note - if Oracle accept your new bug report it could take years to fix even if lots of people vote for it to be fixed.

  • Changing the System time in the JVM where Weblogic runs

    Hi,
    I am trying to change the System time where the Web-logic server (11g) runs using Mocking. I use "jmockit.jar" to mock the System.class. A Spring bean is created and through that I try to change the System time. I need to change the time for testing scenarios. For example, I need to backdate and do the testing for some scenarios. For the moment I do this manually and I want to automate this by changing only the time in the JVM where the application server runs. When I try to automate this using the Spring bean, I get an error as follows. Do anyone have any idea about this.
    [WLServer adminserver] Exception in thread "Timer-5" java.lang.IllegalArgumentException: No class with name "com.abc.common.service.impl.MockSystem" found
    [WLServer adminserver] at mockit.internal.util.Utilities.loadClass(Utilities.java:71)
    [WLServer adminserver] at mockit.internal.MockingBridge.callMock(MockingBridge.java:156)
    [WLServer adminserver] at mockit.internal.MockingBridge.invoke(MockingBridge.java:85)
    [WLServer adminserver] at java.lang.System.currentTimeMillis(System.java)
    [WLServer adminserver] at java.util.TimerThread.mainLoop(Timer.java:495)
    [WLServer adminserver] at java.util.TimerThread.run(Timer.java:462)
    [WLServer adminserver] Exception in thread "DynamicListenThread[Default]" java.lang.IllegalArgumentException: No class with name "com.common.service.impl.MockSystem" found
    [WLServer adminserver] at mockit.internal.util.Utilities.loadClass(Utilities.java:71)
    [WLServer adminserver] at mockit.internal.MockingBridge.callMock(MockingBridge.java:156)
    [WLServer adminserver] at mockit.internal.MockingBridge.invoke(MockingBridge.java:85)
    [WLServer adminserver] at java.lang.System.currentTimeMillis(System.java)
    [WLServer adminserver] at java.util.logging.LogRecord.<init>(LogRecord.java:139)
    [WLServer adminserver] at com.bea.logging.BaseLogRecord.<init>(BaseLogRecord.java:33)
    [WLServer adminserver] at com.bea.logging.BaseLogRecord.<init>(BaseLogRecord.java:48)
    [WLServer adminserver] at com.bea.logging.BaseLogRecord.<init>(BaseLogRecord.java:70)
    [WLServer adminserver] at weblogic.logging.WLLogRecord.<init>(WLLogRecord.java:63)
    [WLServer adminserver] at weblogic.logging.JDKLoggerFactory.createBaseLogRecord(JDKLoggerFactory.java:74)
    [WLServer adminserver] at com.bea.logging.LoggingService.log(LoggingService.java:216)
    [WLServer adminserver] at weblogic.server.ServerLogger.logListenThreadFailure(ServerLogger.java:205)
    [WLServer adminserver] at weblogic.server.channels.DynamicListenThread.run(DynamicListenThread.java:197)
    [WLServer adminserver] at java.lang.Thread.run(Thread.java:619)
    [WLServer adminserver] Exception in thread "weblogic.timers.TimerThread" java.lang.IllegalArgumentException: No class with name "com.abc.common.service.impl.MockSystem" found
    [WLServer adminserver] at mockit.internal.util.Utilities.loadClass(Utilities.java:71)
    [WLServer adminserver] at mockit.internal.MockingBridge.callMock(MockingBridge.java:156)
    [WLServer adminserver] at mockit.internal.MockingBridge.invoke(MockingBridge.java:85)
    [WLServer adminserver] at java.lang.System.currentTimeMillis(System.java)
    [WLServer adminserver] at weblogic.timers.internal.TimerThread$Thread.run(TimerThread.java:256)
    [WLServer adminserver] Exception in thread "Timer-4" java.lang.IllegalArgumentException: No class with name "com.abc.common.service.impl.MockSystem" found
    [WLServer adminserver] at mockit.internal.util.Utilities.loadClass(Utilities.java:71)
    [WLServer adminserver] at mockit.internal.MockingBridge.callMock(MockingBridge.java:156)
    [WLServer adminserver] at mockit.internal.MockingBridge.invoke(MockingBridge.java:85)
    [WLServer adminserver] at java.lang.System.currentTimeMillis(System.java)
    [WLServer adminserver] at java.util.TimerThread.mainLoop(Timer.java:495)
    [WLServer adminserver] at java.util.TimerThread.run(Timer.java:462)
    [WLServer adminserver] Exception in thread "ClusterNode-localhost" java.lang.IllegalArgumentException: No class with name "com.abc.common.service.impl.MockSystem" found
    [WLServer adminserver] at mockit.internal.util.Utilities.loadClass(Utilities.java:71)
    [WLServer adminserver] at mockit.internal.MockingBridge.callMock(MockingBridge.java:156)
    [WLServer adminserver] at mockit.internal.MockingBridge.invoke(MockingBridge.java:85)
    [WLServer adminserver] at java.lang.System.currentTimeMillis(System.java)
    [WLServer adminserver] at EDU.oswego.cs.dl.util.concurrent.Latch.attempt(Unknown Source)
    [WLServer adminserver] at org.apache.jackrabbit.core.cluster.ClusterNode.run(ClusterNode.java:261)
    [WLServer adminserver] at java.lang.Thread.run(Thread.java:619)
    [WLServer adminserver] Exception in thread "Timer-1" java.lang.IllegalArgumentException: No class with name "com.abc.common.service.impl.MockSystem" found
    [WLServer adminserver] at mockit.internal.util.Utilities.loadClass(Utilities.java:71)
    [WLServer adminserver] at mockit.internal.MockingBridge.callMock(MockingBridge.java:156)
    [WLServer adminserver] at mockit.internal.MockingBridge.invoke(MockingBridge.java:85)
    [WLServer adminserver] at java.lang.System.currentTimeMillis(System.java)
    [WLServer adminserver] at java.util.TimerThread.mainLoop(Timer.java:495)
    [WLServer adminserver] at java.util.TimerThread.run(Timer.java:462)
    [WLServer adminserver] Exception in thread "ClusterNode-localhost" java.lang.IllegalArgumentException: No class with name "com.abc.common.service.impl.MockSystem" found
    [WLServer adminserver] at mockit.internal.util.Utilities.loadClass(Utilities.java:71)
    [WLServer adminserver] at mockit.internal.MockingBridge.callMock(MockingBridge.java:156)
    [WLServer adminserver] at mockit.internal.MockingBridge.invoke(MockingBridge.java:85)
    [WLServer adminserver] at java.lang.System.currentTimeMillis(System.java)
    [WLServer adminserver] at EDU.oswego.cs.dl.util.concurrent.Latch.attempt(Unknown Source)
    [WLServer adminserver] at org.apache.jackrabbit.core.cluster.ClusterNode.run(ClusterNode.java:261)
    [WLServer adminserver] at java.lang.Thread.run(Thread.java:619)
    [WLServer adminserver] Exception in thread "Timer-2" java.lang.IllegalArgumentException: No class with name "com.abc.common.service.impl.MockSystem" found
    [WLServer adminserver] at mockit.internal.util.Utilities.loadClass(Utilities.java:71)
    [WLServer adminserver] at mockit.internal.MockingBridge.callMock(MockingBridge.java:156)
    [WLServer adminserver] at mockit.internal.MockingBridge.invoke(MockingBridge.java:85)
    [WLServer adminserver] at java.lang.System.currentTimeMillis(System.java)
    [WLServer adminserver] at java.util.TimerThread.mainLoop(Timer.java:495)
    [WLServer adminserver] at java.util.TimerThread.run(Timer.java:462)
    [WLServer adminserver] Exception in thread "weblogic.time.TimeEventGenerator" java.util.MissingResourceException: Can't locate bundle for class 'weblogic.common.T3MiscLogLocalizer'
    [WLServer adminserver] at weblogic.i18ntools.L10nLookup.getLocalizer(L10nLookup.java:427)
    [WLServer adminserver] at weblogic.i18n.logging.CatalogMessage.<init>(CatalogMessage.java:47)
    [WLServer adminserver] at weblogic.common.T3MiscLogger.logThrowable(T3MiscLogger.java:325)
    [WLServer adminserver] at weblogic.time.common.internal.TimeEventGenerator.run(TimeEventGenerator.java:126)
    [WLServer adminserver] at java.lang.Thread.run(Thread.java:619)
    OR
    Do anyone know any other way to overcome this issue using some other mocking jar.
    Thanks
    Edited by: 913136 on Feb 8, 2012 2:32 AM

    Hi,
    I could manage to change the time in JVM where the Weblogic server runs. I loaded an Spring bean from my Test class and from that bean I set an offset (to shift the time) in the Mock class (say, MockSystem class). In this case I used the jmockit implementation for instrumentation purposes. The MockSystem class should not be instantiated by us and jmockit takes care of that part. What I had to do was defining the javaagent and another parameter ("-Djmockit-mocks=com.abc.common.service.impl.MockSystem") in the Weblogic server build XML (mentioned in the following URL[1]). But to work this the MockSystem.class file should be wrapped in a JAR file and included in Weblogic server/lib directory and define it in the Weblogic build XML file as a classpath. For more explanations visit this URL [2].
    [1]. http://jmockit.googlecode.com/svn/trunk/www/javadoc/mockit/Mockit.html#setUpStartupMocks%28java.lang.Object...%29
    [2]. http://code.google.com/p/jmockit/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Tool%20Type%20Status%20Priority%20Summary&groupby=&sort=&id=207
    Thanks
    -thiwanka-

  • The impact of changing SAP system time zone.

    Hello gurus,
    We are in the company located in UTC+8 Time Zone. but during the system installation, the setting in SAP (tcode:STZAC) of the system time zone is CET, which is, not correct, and cause some issues: such as, when we try to send mail via SAP smtp, the sent time in the mail is always wrong.
    We tried to modify it to UTC+8, but since we already go live for several months, there're lots of application data in the system. Before that we need to make sure that this change will not affect the current implementation.
    Do you experts know the impact or risk of changing the system time zone after going live?
    Regards,
    Charlie

    Lets look at this from a logic perspective,  if your system is CET and you are moving to UTC+8 you are going a few hours ahead... so basically you'll find a gap in time in between the documents but you wont find any time conflict. So based on that it should be safe. You certainly need to check your jobs and make sure all necesary jobs will run so you can reschedule them if skipped by the time change (I guess).
    Regards
    Juan

  • Change of system time in SAP

    Hi
    We wanted to change the system time in SAP and we have already posted certain documents.
    Pls let me know, if we change the time.
    Will there be any impact on the posted documents
    Regards
    Madhan D

    Hi,
    Changing system time would ideally can have impact on transactional documents created.
    You need to ensure that there are no post dated open documents as it may clash with change in time.
    Eventuall changing the time post 12 mid night would be a good option.
    Hope this helps.
    Regards,
    Deepak Kori

  • Capture Time Changed by System Time Zone?

    Hi All,
       In Lightroom 1.4, changing the system time in Windows XP changes the capture time!
       This seems crazy...I take photos in different time zones, and have the camera set correctly in that timezone (or adjust it to be correct in Lightroom). I'd rather not change my system timezone to "Bangkok" to correctly see data for photos from Thailand.
       Anyone have a solution or workaround? Is this fixed in LR 2?
    Thanks!
       Alex

    This post seems to explain a lot.
    http://www.lightroomforums.net/index.php?topic=359.msg13336#msg13336
    So I'm stuck having Lightroom adjust times based on the timezone of my OS? Or is there a workaround?...maybe saving and re-importing metadata? (Can't get this to work either, even using some complex procedure I found using Exiftools and a batch file...)
    I can understand the capture time relying on the OS for timezone at the time of import, but Lightroom should not continuously adjust it every time you view...
    Thanks,
       Alex

  • Changing the System Time

    I am using a SunBlade 1000 and C++ with Workshop 6.1. I would like to change the system time via a program written in C++ without having to log in as super-user. Is that possible ? I was thinking about using the settimeofday function, but according to the man information I only can use it as super-user.

    You are correct. Only root can set the system time. You should
    probably consult your local system admin or discuss the implications
    of trying to do this in the Solaris forum. There are possible security
    holes opened up by trying to do root's job programatically.
    In general, a C program can use the system() call to run a command
    that would be typed in at the shell. A program can also have the
    Set UID bit and run as root, but you should be well aware of the
    risks associated with that before you try to use it.

  • When i change os system time to 1987 before, the database is crashed.

    What impact to oracle when change os system time? and how to do this?

    Question is why you want to do that?
    Some tester to do it, i need an explain to it.
    Did you already tried this and database crashed?
    Yes.
    Did you stop the database?
    No.
    What's Oracle version? OS?
    oracle
    11.1.0.7.0
    os
    SUSE Linux Enterprise Server 10 (i586)
    VERSION = 10
    PATCHLEVEL = 2

  • Remove Local System from Change The System Time

    Hello,
    Is there any way to remove the Local Service account from policy "Change the system time"?
    I created a policy to only give permission for the Administrators and Power Users group, but when I run the AccessChk tool, the result is:
    administrators
    Power Users
    Local System
    Regards

    > Is there any way to remove the Local Service account from policy "Change
    > the system time"?
    No. Local System is the "godfather of your computer" and cannot be
    restricted.
    Martin
    Mal ein
    GUTES Buch über GPOs lesen?
    NO THEY ARE NOT EVIL, if you know what you are doing:
    Good or bad GPOs?
    And if IT bothers me - coke bottle design refreshment :))

  • Java thread sleeps forever

    i am using the following code the problem i am facing is that the thread does not return from sleep only in one condition.can any one guide me regarding this.
    can i know in what condition the java thread does not return after sleep.
    while(ivIsActive)
    // call some functions
    try
    Thread.currentThread().sleep(ivSleepTime * 1000);
    catch (InterruptedException iException)
    { //............     }

    wait (even with a timeout) and sleep really have
    rather different functions and I'd be disinclined to
    use wait where sleep was appropriate.If you ever what a sleep() to finish early use a wait().
    If you try to interrupt a sleep there is no guarentee that this will not interrrupt in an unexpected place. With wiat you can be sure only thread waiting on a given object will receive the notify.
    I almost never use sleep in preference for wait for this reason.
    I consider it unwise to place much dependence on a notify not occuring, A notify should occur when you execute it. If you don't call notify, it doesn't.
    you might use wait/notify on the object in question for some unrelated purpose
    in different threads, forgetting this sleep. The notify should signify that a change has occured. The code should then test what has changed and what it should do about it. If you use this approach there is little impact in using the same notify for different purposes. If this is of real concern and you can use a dedicated object for notifying a change in the isAlive state (and make it private)
    (I invariably use while tests before wait, rather than if tests).Could you clarify this point?
    I think wait(time) should be regarded as a semaphore wait with timeout.I agreee. An if you want a Thread.run() loop to exit in a timely fashion then wait() is the thing to use. If you it is a requirement that the loop exit after the 30 second, then use sleep();
    Anyway, as to the original problem I think you need
    to make 500% sure that ivSleepTIme is what you think
    it is (because I'd be extremely surprised if it is).
    This is probably a good place for an assertion.I would also check that isAlive is really changing. It is not uncommon to be changing the isAlive in another context, or another object, or not at all.

  • Java Thread.sleep() on Windows 8 stops in S3 sleep status

    There's a desktop application that uses Thread.sleep() to achieve long (minutes or hours) delays. This same application has been working fine from Windows XP through Windows 7. The application calculates how far in the future it needs to do something, then hits a Thread.sleep(msToWait). This has been working fine, even if the system happens to go into S3 or S4 sleep state during the wait.  All is good as long as the machine is awake at the time when the sleep expires.
    As of Windows  8 (and 10), though, the code after Thread.sleep() does not execute "on time" if the machine has been in S3 during the sleep interval. It appears that the machine begins executing code at "msToWait" plus the time the machine has been in S3.
    Earlier versions of Windows did not exhibit this behavior; code after Thread.sleep() waited the right amount of time, irrespective of sleep status.
    A test program and procedure were developed. The procedure is to 1) run the program, 2) cause the machine to sleep for about a minute, then 3) wake the machine and wait for the program to finish.
    If this the program is run on Windows 10 (reporting as 8) with JVM Version: 25.40-b25, it fails (the 63589 corresponds to the minute that the machine was in S3):
    C:\Users\Tester\Downloads>SleepTester.exe
    Wed Apr 01 10:47:35 PDT 2015 Using default number of minutes: 5
    Wed Apr 01 10:47:35 PDT 2015 You can use "SleepTester -minutes 10" to have it sleep for 10 minutes, for example.
    Wed Apr 01 10:47:35 PDT 2015 JVM Version: 25.40-b25 Windows Version: Windows 8
    Wed Apr 01 10:47:35 PDT 2015 The program will now wait for 5 minutes.  Expect wrap-up at Wed Apr 01 10:52:35 PDT 2015
    Wed Apr 01 10:53:38 PDT 2015 The system has come through the Thread.sleep(300000).
    Wed Apr 01 10:53:38 PDT 2015 This should be a low number: 63589
    Wed Apr 01 10:53:38 PDT 2015 This appears to be operating incorrectly...the expected sleep time has NOT been achieved.
    Wed Apr 01 10:53:38 PDT 2015 Program is ending.
    If the process is run on Windows 7, it does not fail:
    Wed Apr 01 17:12:18 EDT 2015 Java Runtime Version: 1.8.0_31-b13 JVM Version: 25.31-b07 Windows Version: Windows 7
    Wed Apr 01 17:12:18 EDT 2015 The program will now wait for 6 minutes.  Expect wrap-up at Wed Apr 01 17:18:18 EDT 2015
    Wed Apr 01 17:18:18 EDT 2015 The system has come through the Thread.sleep(360000).
    Wed Apr 01 17:18:18 EDT 2015 This should be a low number: 0
    Wed Apr 01 17:18:18 EDT 2015 Program is ending.
    This is the guts of  test program:
    [code]
    public static void main(String[] args) throws Exception {
       System.out.println(new Date() + " Java Runtime Version: " + System.getProperty("java.runtime.version") + " JVM Version: " + System.getProperty("java.vm.version") + " Windows Version: " + System.getProperty("os.name"));
       long msDelay = mMinutes * 60 * 1000;
       long wakePoint = new Date().getTime() + msDelay;
       System.out.println(new Date() + " The program will now wait for " + mMinutes + " minutes. Expect wrap-up at " + new Date(wakePoint));
       Thread.sleep(msDelay); // If the machine goes into S3 during this interval, it should not matter, as long as it's awake when it fires.
       System.out.println(new Date() + " The system has come through the Thread.sleep(" + msDelay + "). ");
       long msAccuracy = Math.abs(new Date().getTime() - wakePoint);
       System.out.println(new Date() + " This should be a low number: " + msAccuracy);
       if (msAccuracy > 1000) System.out.println(new Date() + " This appears to be operating incorrectly...the expected sleep time has NOT been achieved.");
       System.out.println(new Date() + " Program is ending.");
    [/code]
    Was the change in behavior from earlier versions of Windows intentional?  Is it something that the JVM is controlling, or is there a difference in the underlying OS that is beyond the control of the JVM?

    I might need to create a work-around whereby I maintain a watch of the msDelay and the system clock.  If there is a discontinuity (which would only happen on Windows 8 or higher), then I would repair the msDelay value.
    A separate (but related) question:
    Can I conclude that since older JVM's running on Windows 8 still have the problem, that it's a Windows issue, and not a JVM issue?

  • How to change the system time in (E-Business Suite)

    Hi,
    I need to change the system timings in E-Business Suite.
    My Database & Application is on different nodes..
    How could i change system timings on both...
    Thanks,
    Alig

    Alig,
    Changing the OS date/time will have no impact on the data (except for the scheduled jobs at the database and the OS levels). As mentioned in the threads I referenced above, you have to stop the application/database, change the date/time at the OS level, and start the application.
    The application is just an interface which connects to the database, so it gets all the data from the database server. However, if you want to change the date/time it has to be done on both nodes (stop all the services first as mentioned above).
    Btw, what is the point of changing the date/time because of Ramadan? The business requirement of your client does not make sense (how does it differ from the application/database perspective if you start working at 9:00 AM instead of 7:00 AM for example)?
    The steps in the document should be enough, and if you do not trust any of the replies here you could simply log a SR and confirm this with Oracle support.
    Thanks,
    Hussein

  • In Java,how can I get remote oracle server's system time using a XAOracle datasource

    I want to get remote oracle server's system time,for example,I use a TxDataSource:
    DRIVER className:weblogic.jdbc.oci.xa.XADataSource
    URL:jdbc:weblogic:oracle:lanhaibo
    JNDI Name:
    the following is the code which shows the exception that: sqlexception:the JDBC2.0
    method is not implemented,why? what should I do?:
    Properties prop = new Properties();
    prop.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    prop.put(Context.PROVIDER_URL,"t3://"+"localhost"+":" + "7001");
    initCtx = new InitialContext(prop);
    DataSource ds = (DataSource)initCtx.lookup(strDataSource);
    Connection conn = ds.getConnection();
    String sqlQuery = "select to_char(sysdate,'yyyy') YYYY,to_char(sysdate, 'MM')
    MM,to_char(sysdate, '" +
    "dd') DD,to_char(sysdate, 'hh24') HH,to_char(sysdate, 'mi') MI,to_char(sysdate,
    '" +
    "ss') SS from dual"
    preparedStatement pstmt = conn.prepareStatement(sqlQury);
    StringBuffer sb = new StringBuffer();
    ResultSet resultset = pstmt.executeQuery();
    if(rs.next()){
    strYear = rs.getString("yyyy");
    strMonth = rs.getString("MM");
    strDay = rs.getString("DD");
    strHour = rs.getString("HH");
    strMinute = rs.getString("MI");
    strSecond = rs.getString("SS");
    sb.append(strYear);
    sb.append("/");
    sb.append(strMonth);
    sb.append("/");
    sb.append(strDay);
    sb.append(" ");
    sb.append(strHour);
    sb.append(":");
    sb.append(strMinute);
    sb.append(":");
    sb.append(strSecond);

    Joden asked:
    "I want to get a remote oracle server's time by XADataSource,
    use:"select sysdate from dual", but return a null value,and give
    the message"sqlexception the jdbc2.0 method is not implemented",
    why?"
    Let me see your code. A simple executeQuery() should do the trick:
    Statement s = c.createStatement();
    ResultSet r = s.executeQuery("select sysdate from dual");
    while (r.next())
    java.sql.Timestamp t = r.getTimestamp(1);
    Guillaume Grussenmeyer wrote:
    Hi.
    I guess you are using weblogic.jdbc.oci.xa.XADataSource as a
    datasource.
    Weblogic JDriver for Oracle "implementation" is really weak as a lot
    of methods are not implemented.
    This is why you get this message.
    You may find the (very impressive) list of non implemented methods at
    http://e-docs.bea.com/wls/docs70/oracle/API_joci.html#1162621 (sorry
    HTML links don't seem to work here).
    Any call to one of this methods will give you these nasty message and
    exception.
    Try to use the "official" Oracle JDBC driver XA Datasource
    (oracle.jdbc.xa.client.OracleXADataSource) instead of Weblogic JDriver
    for Oracle one's.

  • Changing Unity System Time

    Hi,
    I recently changed the date & time on the Unity 4.0 server, but I dont for some reason prompts pickup the old date & time. Has anyone faced this problem.
    Thanks in Advance
    Chetan

    Hi,
    For sy-timlo see the documentation..
    In the following cases, the local time cannot be calculated:                                                                               
    -   The time zone has not been entered in the user master record
            or                                                                               
    -   The time zone in the user master record is invalid          
            or                                                                               
    -   The time zones are inactive (table TTZCU).                                                                               
    If this happens, the system time (SYST-UZEIT) is returned.                                                                               
    Thanks,
    Naren

  • How to change system time from Java

    Could someone tell me if there is possibility to change the system time, from within a Java program. And how to do it.

    In general, no.
    You could do it using JNI if you're running your JVM
    with sufficient system privileges.
    It seems a highly questionable thing to want to do.
    Why do you have a requirement for this?
    Sylvia.Now there's an idea (thread now has a 'watch'), I think I'll drop the the idea of being a hacker and learn how to write viruses instead - happy days ahead ...

Maybe you are looking for