Apex 4.1 bug? Application language derived from Session changes time zone

I have created an application in Apex 4.1 and in the "Initialization PL/SQL Code" for the session (what used to be called the VPD section) I have the following code:
begin
  execute immediate 'alter session set time_zone = ''+01:00''';
end;This works as expected, UNLESS the "Application Language Derived From" (under "Edit Globalization Attributes") is set to "Session", in which case the session's time zone is also affected (and not just the language, as one would expect).
This can be seen in the following simple example, which runs the above code to set the time zone, and has the language derived from "Session":
http://apex.oracle.com/pls/apex/f?p=38595
This shows
sessiontimezone = -05:00Even though the session's time_zone has been explicitly set to +01:00 with the ALTER SESSION statement.
Experimentation with the URL shows that if a p_lang parameter is passed, with a valid language identifier, for example:
http://apex.oracle.com/pls/apex/f?p=38595&p_lang=de
then the time zone is affected (showing -05:00 instead of +01:00).
However, if an INVALID time zone identifier is passed:
http://apex.oracle.com/pls/apex/f?p=38595&p_lang=xx
then the session time zone is CORRECT according to the ALTER SESSION command:
sessiontimezone = +01:00If I change the "Application Language Derived From" to something else than "Session" (for example, "Browser" or "Item Preference"), then the timezone is also correct (ie follows the ALTER SESSION command).
Running the page in debug mode confirms that the time zone is being set after my VPD/initialization code has been run:
0.01585     0.00146     ...Application session: 1671806996734123, user=nobody     4     
0.01731     0.00144     ...Execute Statement: begin begin execute immediate 'alter session set time_zone = ''+01:00'''; end; end;     4     
0.01875     0.00065     Session: Fetch session header information     4     
0.01940     0.00073     SESSION Language (nobody): wwv_flow.g_browser_language=en maplang=en     4     
0.02013     0.00059     alter session set nls_language="AMERICAN"     4     
0.02071     0.00043     alter session set nls_territory="AMERICA"     4     
0.02114     0.00094     NLS: CSV charset=WE8MSWIN1252     4     
0.02208     0.00111     ...NLS: Set Decimal separator="."     4     
0.02318     0.00062     ...NLS: Set NLS Group separator=","     4     
0.02380     0.00063     ...NLS: Set g_nls_date_format="DD-MON-RR"     4     
0.02443     0.00091     ...NLS: Set g_nls_timestamp_format="DD-MON-RR HH.MI.SSXFF AM"     4     
0.02534     0.00066     ...NLS: Set g_nls_timestamp_tz_format="DD-MON-RR HH.MI.SSXFF AM TZR"     4     
0.02600     0.00050     ...Setting session time_zone to -05:00     4     
0.02650     0.00065     Setting NLS_DATE_FORMAT to application date format: dd.mm.yyyy     4     
0.02715     0.00056     ...NLS: Set g_nls_date_format="dd.mm.yyyy"     4     
0.02771     0.00055     ...NLS: Set g_nls_timestamp_format="DD-MON-RR HH.MI.SSXFF AM"     4     
0.02827     0.00057     ...NLS: Set g_nls_timestamp_tz_format="DD-MON-RR HH.MI.SSXFF AM TZR"     4     
0.02884     0.00230     NLS: Language=en     4     
Conclusion: It seems to me that when the LANGUAGE is set to be derived from the "Session", this also, as a side effect, alters the session TIME ZONE, which must be a bug... ?
- Morten
http://ora-00001.blogspot.com
Edited by: mobra on Sep 24, 2011 7:14 PM

Hi Arie,
When you are setting the language to derived from session you actually declare that you are working in a dynamic environment – per session – and not in a static one. Using the Initialization PL/SQL Code is very static as the same code is executed for every database session.I was using a fixed time zone value in the ALTER SESSION to demonstrate the bug/problem... in real life, the actual time zone is derived dynamically based on a user profile stored in the database.
APEX 4.0 introduced the Automatic Time Zone under the Globalization tab. By default it’s set to No but setting it to Yes will allow you to use your local time zone (as derived from your browser) with whatever language derived setting you choose, including per session with the *&p_lang* parameter.The key point is that LANGUAGE has nothing to do with TIME ZONEs, and vice versa. People speak English (and Spanish, and French, and Chinese for that matter) all over the world. You cannot determine a user's time zone based on the chosen language.
You're telling me to enable "Automatic Time Zone" to work around an unwanted side effect from changing the language setting. Sorry, but that just sounds like bad advice to me.
If you want to use session derived language, however the local time zone settings are not good for you, you can still change them with a Before Header and After Submit PL/SQL processes and an appropriate alter session statement, on a per page base. The APEX engine will not ignore a page based session setting.Why should I have to do this for every page when the "VPD" Section (now called "Initialization PL/SQL Code") is made for this purpose?
If you look at the help text in the Apex builder for that section, it actually says that:
The code entered here need not pertain to VPD/FGAC and may not be related to security at all.
Any code that needs to be executed at the earliest point in a page request can be placed here.
For example, the following code sets the database session time zone for every page request:
BEGIN
   EXECUTE IMMEDIATE 'alter session set time_zone = ''Australia/Sydney'' ';
END;So I hope the demonstrated behavior is not intentional, but a bug, and I'm hoping Joel sees it the same way.
- Morten
http://ora-00001.blogspot.com

Similar Messages

  • RTL Issue based on Application Language Derived From - Item Preference

    Hi All,
    Application Express 4.0.1.00.03
    I am trying to create a Multi-Lingual Application.
    1. Created an Application Item "FSP_LANGUAGE_PREFERENCE".
    2. Application Globalization Property : Application Language Derived From - Item Preference
    3. On the login page I have a Select List P101_LNG to choose Language.
    STATIC2:English;en-us,Arabic;ar-kw4. On Login Page created computation for
    Item Name : FSP_LANGUAGE_PREFERENCE
    Type : Item Value
    Computation Point : After Submit
    Computation : P101_LNG
    5. I have done all the Translation steps like Creating Mapping with Language Code ar-kw, Seed translatable text to translation repository, downloaded translatable XLIFF file, updated the target for the file and then uploaded and published.
    Now when I run the forms the pages does not appear Right to Left on Selection of Arabic Language on the Login form.
    Note: On using Application Language Derived From - Browser (use browser language preference) it works fine.
    Am I missing something? Have I done something wrong?
    Please help.
    Thanks & Regards
    Arif Khadas

    Now there is different problem though.
    Once I click on Logout I get the following error:
    Error ERR-1016 Application "1000" Page "101" not found (requested language="en-us")
    Page 101 is the Login Page and it exists, even then why such an error.
    Thanks & Regards
    Arif Khadas

  • Setting the item for globalization with application language derived...

    Hi guys,
    i would like to try translation based on item preference.
    I've these settings.
    Application Primary Language: italian
    Application Language Derived From: item prefercence (english)
    I've tested the translation with browser settings and it works.
    Now i want to have a fixed language.
    How can i specify this item?
    For example i want a static global var containing the language called CUR_APP_LAN
    Wich value i have to assign to CUR_APP_LAN and where i say to apex that it has to use CUR_APP_LAN for translation?
    Thanx a lot.

    You have to create an item (application item) named FSP_LANGUAGE_PREFERENCE and set its value to 'it'.
    Scott

  • Oracle Application Server 10.1.3 R3 - Change time zone

    Hii All,
    I am using Oracle application Server 10.1.3 R3 Version. I have installed this application server on my windows VISTA machine. On Concole, OracleAS showing GMT time. I need to set it to Indian timezone.
    I have searched a lot but not getting success.
    Can anybody help me, how to change time zone ?
    Regards,

    have a look at this document in metalink. might be helpful . i think you to apply a patch based ( download it from metalink according to your operating system and applicaiton server versions). in my case i have download 5632264 patch ( 10.1.2.0.2 AS & AIX OS).
    Timestamps & time zones - Frequently Asked Questions
         Doc ID:      Note:340512.1
    Thanks,

  • Indian Time Zone missing from UCM User Time Zone Field

    Hi,
    I am using UCM version 11.1.1.3.0.
    The Indian time zone option is missing from the User Time Zone Drop down in the weblogic section.
    When I set User Time Zone value to (GMT+5:30)Colombo- Sri Lanka Time (LKT) which is same as Indian time zone, the time reflected in UCM is --> System time + 30 minutes
    When I set User Time Zone value to (GMT+5:00)Karachi Pakistan Time- (PKT) which lags 30 minutes from the Indian time zone, the time reflected in UCM is --> System time - 30 minutes
    How can I get the Indian time in User Time Zone Field (as it is present in other versions of UCM)?

    Hi ,
    Download Patch 13503004: UCM 11.1.1.3.0 patch (20120103_1059) from MyOracleSupport portal and upgrade the server .
    After that restart it to see if that the IST TZ will be shown .
    Thanks
    Srinath

  • Is my iPhone calendar reading from the wrong time zone? How do I fix it?

    First, here is all the info that I have about all of the clocks on my phone: the date and time on my iPhone are set automatically to Vancouver's time zone, in the Clock app though, I've also added in the clocks for Seoul and Manila so that I know the time when I need to contact friends out there, etc. Location wise, everything else on my phone is fine: my map correctly shows where I am, the weather app shows the weather for my city and my clock changes automatically for daylight savings.
    Now, when I put in an event into the calendar app, while putting in the details such as start and end time, the Time Zone slot is always set to Seoul for some reason. I have to go in and change it to Vancouver manually. Even after doing this and setting everything though, the alarm always goes off at the wrong date and time - I think it' s going off at when that time reaches Seoul, not Vancouver. So then I tried setting it again, this time, leaving the time zone as Seoul in case things were somehow just 'backward' in my phone, and still the alarm went off at the wrong date and time.
    I really can't understand it and haven't got the faintest clue as to how to fix it. Any ideas??
    In case this better or further explains what I'm trying to say:
    I just opened a new event on my calendar. I set it to begin twenty minutes from now (5:20AM) and left the ending time as the default one hour later (6:20AM). I also did not change the time zone which is already reading Seoul for whatever reason. I hit done, I'm taken back to the main calendar page, and there it shows as it should: 5:20AM today. I then went to set second event for 5:15AM only this time, I changed the timezone to Vancouver. All the information looks correct, but this time, when I hit done and am taken to the main calendar page, that event is recorded as having been set to 21:15PM instead!!
    [ I have an iPhone 4 but...I don't know what CDMA or GSM means so I'm not sure which pertains to me...]

    Go to Settings>Mail, etc.>iCloud and delete the account. Then add in a new account with the details you want.

  • How to make a smart album from a particular time zone?

    I would like to make a smart album that contains photos taken in a particular time zone. But I could not find out the way to add a rule to read time zone information. Could anyone tell me how to retrieve the time zone information from the filter panel of Aperture 3?

    to add a rule to read time zone information.
    I could not find any metadata tag in aperture, that contains the Time Zone and is readable in the smart settings HUD.
    Yu could try it indirectly - since the Time Zone is widely determined by the longitudes of the eastern and western boundaries of the zone, you could check for these longitude values, if your photos are geotagged or have Places assigned.
    For example, to find the timezone of UTC+1 use these settings:
    EXIF > Longitude is in the Range of: 7.7 to 22.5.
    Depending on the countries, you may need to combine this rule with latitude rules as well or make a rule that simply uses the country names from the places tags.
    For which timezone do you need the rule?
    http://www.timeanddate.com/time/map/

  • Can I restore my applications and data from a ML time machine back up to a machine running Lion?

    Because of the horrible battery life with Mountain Lion (10.8.2), I am looking to downgrade to Lion. I have a Time Machine backup of my current machine, running ML. I do not want to restore all the way back to my last Lion backup, because that was a while ago. Basically, I want to backup my current ML hard drive, erase the computer, perform a fresh Lion install, and restore my apps/data using the ML Time Machine backup. Is the ML Time Machine backward compatiable with Lion?

    jgian wrote:
    Because of the horrible battery life with Mountain Lion (10.8.2)
    I am unaware of any battery life problem with Mountain Lion. There are many problems with incompatible 3rd party software, but that is a different problem.
    I wrote a little diagnostic program to help show what might be causing these problems. Download EtreCheck from http://www.etresoft.com/download/EtreCheck.zip, run it, and paste the results here.
    Will the ML Time Machine be backwards compatiable with Lion?
    No. 3rd party application may be fine. Most Apple applications and data will not work.
    Disclaimer: Although EtreCheck is free, there are other links on my site that could give me some form of compensation, financial or otherwise.

  • Find time offset from GMT using time zone

    Hi,
    Is there any way i can query the time offset from GMT using the timezone of a place.
    E.g. If I am in India
    My TZNAME is 'Asia/Calcutta' and TZABBREV='IST'
    How can i get the time offset from GMT for this timezone?
    In this case I want +5:30 as the result.
    Regards
    Ravi

    SQL> select dbtimezone
      2  from dual;
    DBTIME
    +01:00
    SQL> Regards,
    Gerd

  • How do I fix my web browsers time zone it is 2 hours off set from my computers time zone?

    I payed for some things on lowes.com and the confirmation time was 2 hours fast. I then sent some one some money on WesternUnion.com and it's confirmation time was also 2 hours fast. It is some how set to East Coast time zone I'm guessing, I'm mountain time zone.

    Your browser doesn't have a time zone preference that you can set. Check your settings on the website in question instead.
    For example, for Gmail, click the drop-down arrow next to your email address on the inbox page, then click the Account link. Then click the Edit link below your email address and set your time zone there.
    * https://www.google.com/settings/account

  • APEX 4.2.1 bug - Automatic language detection

    Hi,
    we found a bug in the currect version of Oracle APEX 4.2.1:
    Browser language can not be used in applications during the runtime.
    We are developing mostly German applications but database standard character set is:
    SELECT * FROM NLS_DATABASE_PARAMETERS
    Parameter Value
    NLS_LANGUAGE     AMERICAN
    NLS_TERRITORY     AMERICA
    NLS_CURRENCY     $
    NLS_ISO_CURRENCY     AMERICA
    NLS_NUMERIC_CHARACTERS     .,
    NLS_CHARACTERSET     WE8ISO8859P15
    NLS_CALENDAR     GREGORIAN
    NLS_DATE_FORMAT     DD-MON-RR
    NLS_DATE_LANGUAGE     AMERICANAll applications are set up with "Globalization Attributes":
    Application Primary Language: German
    Application Language Derived From: Browser (use browser language preference)
    Application Date Format: DD.MM.YYYYIn all former versions of APEX it changes the default settings from the database to the browser settings. In the current version it does NOT change the language.
    For example: APEX 4.1 number value
    10.000,00
    APEX 4.2.1 number value
    10,000.00
    If I check the debug log I find this:
    0.04096     0.00016     S H O W: application="101" page="16" workspace="" request="" session="16485344217862"     4     
    0.04110     0.00044     Reset NLS settings     4     
    0.04155     0.00020     alter session set NLS_LANGUAGE="AMERICAN"     4     --> This is the default behavior
    0.04174     0.00016     alter session set NLS_TERRITORY="AMERICA"     4     
    0.04189     0.00014     alter session set NLS_CALENDAR="GREGORIAN"     4     
    0.04203     0.00014     alter session set NLS_SORT="BINARY"     4     
    0.04217     0.00017     alter session set NLS_COMP="BINARY"     4     
    0.04234     0.00003     ...NLS: Set Decimal separator="."     4     
    0.04237     0.00014     ...NLS: Set NLS Group separator=","     4     
    0.04251     0.00013     ...NLS: Set g_nls_date_format="DD-MON-RR"     4     
    0.04264     0.00013     ...NLS: Set g_nls_timestamp_format="DD-MON-RR HH.MI.SSXFF AM"     4     
    0.04277     0.00032     ...NLS: Set g_nls_timestamp_tz_format="DD-MON-RR HH.MI.SSXFF AM TZR"     4     
    0.04309     0.00005     NLS of database and client differs, characterset conversion needed     4     
    0.04314     0.00257     ...Setting session time_zone to +01:00     4     
    0.04572     0.00005     NLS: Language=       --> No changes are made, default language will stayIssue happens in all browsers: FF, Chrome, IE
    Somebody else had similar issues as we did:
    Apex 4.2 - Not clear behaviour with translated applications
    Hope you can help. You may even have a workaround? Problem is especially difficult with translated applications!
    Thanks
    Tobias

    Good to hear this is already being worked on.
    When we tried to work around the "Automatic detection" bug - changing the "Application Language Derived From" to "Application Preference" or "Session" - we hit issue that some page processes were not firing in translated application.
    See Page processes not firing in Translated applications
    Jan

  • Reports - "Derive from Page Item" Missing in APEX 3.0.1?

    I installed a patch 3.0.1.
    I can't find on the list of formats in report queries option:
    "Derive from Page Item"
    But, in help window for the list of formats I can read:
    "The format attribute specifies the download format for the report query.
    Report queries can be downloaded as PDF documents, Word documents (RTF
    based), Excel Spreadsheets
    (HTML based) or as HTML files.
    To determine the download format at runtime of the application, choose
    "Derive from Page Item"."
    Where is "Derive from Page Item" option?
    Best Regards
    Daniel Kozlowski

    Option "Derive from page Item" is still available in 2 places:
    1. "Shared Components -> Report Queries -> Create Report Query" on last
    "Create Shared Query" window.
    I can choose it from "Output Format" list.
    2. In report properties on "Print Attributes" tab.
    I can also choose this option, from "Output Format" list.
    Of course, above options still doesn't work correctly.

  • How do I stop iCal from ever changing the time zones of my appointments?

    I cannot figure out time zone support in iCal, and just want it never to move the time of an appointment when I change time zones. I have tried switching time zone support on and off, and it makes no difference, the appointment times change when the time zone changes. It's infuriating! How do I make it stop?
    Thanks!

    Whitecity,
    According to iCal Help...Changing the time zone for an event: Choose iCal > Preferences, click Advanced, and select the "Turn on time zone support" checkbox...To change the event's time zone, choose a time zone from the pop-up menu in the Info drawer. To make the event appear at the same time no matter what time zone the main calendar view is in, choose Floating..;~)

  • BUG??? Can't  create a class deriving from ActionForm using wizard

    Has anyone managed to create an class deriving from ActionForm class using the wizard in JDev 9033?
    When I try to do create a class by right-clicking.."New"..etc nothing happens!!

    Yeah. Same thing happens for me. I went to File->New->Web Tier->Struts->ActionForm. Can't get it to do anything.

  • Print Button Derived From a Select List Is Not Working

    Hello,
    I followed the instructions "Creating a PDF Report from Derived Output Format" http://www.oracle.com/technology/obe/apex/apex31nf/apex31rpt.htm#t2
    Steps
    In order to derive the output format, you need to create an item that contains the list of formats to select from. Perform the following steps:
    1. Under Items, click the Create icon.
    2. Click Select List.
    3. Make sure Select List is selected for Select List Control Type and click Next.
    4. Change the Name to P<#>OUTPUTLIST and click Next.
    5. You need to specify the list of output types for the report and the bottom of the page. Select the Create or edit static List of Values
    6. Enter the following values and click Apply.
    Display Value Return Value
    PDF PDF
    Word RTF
    Excel XLS
    HTML HTM
    XML XML
    7. Select No for Display Null Option and Click Next.
    8. Change the Label to Output Format and click Next.
    9. Enter PDF for the Default and click Create Item.
    10. Now that the list of output formats is created, you need to change the Output Format when the Print link is selected. Under Regions, select the Print link.
    11. Under Printing, select Derive from Item for Output Format and select the item you just created P<#>OUTPUTLIST for Item and click Apply Changes.
    12. Click Run Page.
    13. When the report is displayed, select Excel from the list of Output Formats. Note: In Oracle Application Express 3.1, the XML format was added
    14. At the bottom of the report, select the Print link.
    15. A window appears asking you which program you want to open the Excel file with. Click OK (or Open depending on what browser you have) . Excel is open and the report is displayed. Close the Excel window.
    16. You can also create a button to produce the report based on the output format rather than clicking the Print link at the bottom of the report. Click Edit Page.
    17. Under Buttons, click the Create icon.
    18. Accept the default and click Next
    19. Select Create a button displayed among this region's items and click Next
    20. Enter P<#>_Print for the Button Name, enter Print for the Label and Request and select HTML Button for Button Style. Then click Create Button
    21. The region printing link contains the id of the region. Since you want to invoke the print from a button instead of the link you need to create a branch and specify the FLOW_XMLP_OUTPUT_R### parameter in the Request field for the Action so the application knows what to do when the Print button is pressed. Under Regions, select the Print link.
    22. Ctrl-C the FLOW_XMLP_OUTPUT_R### section of the Print URL field. Since you are going to invoke the print from the button, you can remove the Print in the Label Link field and click Apply Changes.
    23. Under Branches, select the Create icon.
    24. Accept the default and click Next
    25. Enter the current page for the Page and paste the FLOW_XMLP_OUTPUT_R### parameter that you copied into the Request field and click Next.
    26. Select P<#>_PRINT for When Button Pressed and click Create Branch
    27. Click Run Page
    28. Select XML for the Output Format and click Print.
    If I use the link at the bottom of the report region when I set the print options on the print tab of a report, it will print out in both pdf and rtf formats. I get an error with the Excel format. The print button isn't even working. When I select the button, nothing happens.
    Any help is appreciated.

    Hello Andy,
    I ended up putting in a ticket with Metalink. It is a known bug it seems. This is what the rep said:
    UPDATE
    =======
    These bugs are fixed in the next ApEx patch 3.1.2. Patch 3.1.2 is expected (tentatively) in 2 weeks at the
    earliest.
    The bug fixes for these bugs have been backported to 3.1.1 and the one-off patches (patch 7202883 & 7156139) can be downloaded from metalink. One-of
    f patches do not undergo the normal full regression testing, as is done for the
    full APEX 3.1.2 patch set.
    Once 7202883 and 7156139 were applied, I was able to download in all formats.
    Kelly

Maybe you are looking for