Potential Final initializer bug.

I noticed that the jdk 1.3 compiler, as well a the Visual Age 3.5.3 compiler, will allow this code:
public class FinalTest
     private final int _i;
     FinalTest()
          i();
          _i = 9;
          System.out.println(_i);
     private void i()
          System.out.println(_i);
     public static void main (String args[])
          new FinalTest();
}When I run it, the output is:
0
9This seems like a bug, unless there is some obscure rule about blank finals and calling instance methods which use them BEFORE they are initialized in the constructor. At any rate, this does not seem like a positive feature to me.

On a similar note, does anybody else find it worrying
that you can call non-private, non-final instance
methods from a constructor?
The simple answer is "don't do it", but people do do
it...It would be nice if the compiler could warn about public methods being called from the constructor, but could it detect the following? This particular example would (probably) be picked up rather quickly, but does (should) an external constructor count as a "dangerous" method to call from a constructor? Or only when static state is involved... the rules are starting to get hard :-)
public class A {
    private static final A INSTANCE = new A();
    public static final A getInstance() {
        return INSTANCE;
    private B b;
    private A() {
        b = new B();
    public String getProperty(String key) {
        return "something good";
class B {
    private String prop;
    public B() {
        prop = A.getInstance().getProperty("gimme");
}

Similar Messages

  • Final cut bug, interlacing when adding transitions

    Hello
    So I have been experiencing a problem in final cut pro 6 when generating a timeline using motion jpeg A and using transitions that all clips end up looking interlaced. The fields in the sequence settings are set to non and all the settings are at high quality. All preferences and settings have been checked a hundred times over. Even soemtimes in the past generating a new sequence and copying your timeline to the new sequence would sometimes resolves some problems.
    After weeks of banging my head against the wall I managed to find out that importing quicktimes into final cut would default the field on every quicktime to upper odd, causing this problem. Changing this option to none seemed to fix the problem. In saying this, this is not ideal as if you were working with say 40 quicktimes or more you would have to manually change each field to every quicktime before you start your timeline. Not good.
    Has anyone else experienced this problem and if so have you found a better way around it?
    Thanks

    Same Issue: Added a transition and then beach ball from **** and crash. Also lost two hours of work when it restarted and reverted to the last planned quit.
    FCPX is benched until Lion and updates. Don't have time to be a beta tester on what might end up being a hobbyists toy.
    MacPro Quad 3.0, 10G RAM.
    Mark

  • IPhoto or Final Cut bug: export creates 19 stereo tracks attached to file!

    I am exporting three slideshows from iPhoto '08 to Quicktime to be placed in a Final Cut Pro project. The first two exported fine. The longest one (just over ten minutes) exports and plays in QuickTime, but when you import to Final Cut, it mysterious has 19 stereo tracks attached, and won't play unless you remove all of those tracks (hence, no music) Again, the shorter two come in just fine with one stereo pair, as you would expect.
    I installed the iPhoto update, tried again, still the same thing...

    Ryan:
    Is it just that one particular slideshow or will any slideshow exported and imported to FCP display that problem? Also, if you have Quicktime Pro, open the problem file with it and check to see if if contains those 19 tracks. If not, then maybe FCP is causing the issue.
    Do you Twango?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've written an Automator workflow application (requires Tiger), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 08 libraries. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.

  • Final cut bugs when I want to export fcp project in FLV format

    Hy, when I did a fcp project, I export it well in QTime conversion to have .mov file.
    But If I want to have a flv file after doing my fcp project, and try to export in flv, Final cut is taking a long time and after few minutes doesn't answering. Can you help me, I have a lot of files to export first in .mov and after in flv. thank you

    http://discussions.apple.com/thread.jspa?threadID=1705856&tstart=0

  • Lightroom 5 Final, Big bug with Function "Light Dim"

    Hello,
    Found this bug in many Pcs (With Win 7) in x64 Bits AND x32
    When i use the option "Lights Dim" (in Menu "Lights Out") when i quit Lightroom 5, lr 5 Crashes after the ending.
    Receive windows message "Lightroom 5 Has Chrashing ...etc..."
    I search to understand, and i think have know.
    Before the V5, no crash (V4.4. for exemple), and with this versions,  "Lights Dim" function is intergrate into "lightroom.exe"
    With the Lr5 Version ONLY  "Lights Dim" is extrenal ans is used by "Slideshow.Dll"
    For verify this, very easy, just move  "Slideshow.Dll" in you desktop, and you see the  "Lights Dim" not run.
    After always testing, you see also the Option "Light Off" runs always good, and "Light On" same.
    This in one little piece of this 3 function is external, it's very dirty, and crashes.
    Pse (developpers) note this bug and in 5.1, integrate this 3 functions into Lightroom5.Exe
    Best regards, and sorry for my very bad English

    I am having the same issue and wondered what was the issue. Thank you for posting; now I remember Lightroom didn't start doing this until I updated to Mac OS Maverick. The only time I don't have that problem is when I physically disconnect my secondary display from my computer.

  • Potential TCP/IP bug

    Hey guys,
    Some weird issue going on with mid 2012 11" MacBook Air with 10.8. Lets start with the topology:
    - MacBook Air connected to TP-LINK access point
    - access point connected to unmanaged switch
    - unmanaged switch is also connected to a Windows Server 2008 R2 with Exchnage 2010 box and a Unix firewall
    - Unix firewall is the DNS server for all devices and forwards request to ISP's box. Firewall also acts as the gateway and has a PPoE client which dials a TP-LINK ADSL2+ modem in bridged mode
    so, MBA-->switch-->unix fw/gw-->modem bridge mode-->ISP
    Here are the symptoms:
    - MBA with 10.7 able to continously ping google.com and internal Exchnage server
    - iPhone and iPad able to do the same
    - Once upgraded to 10.8, MBA sometime uses a self-assigned IP (169.254.x.x) where renew DHCP lease does not chahnge, the only way to fix is to disable wifi and re-enable
    - Most of the time MBA will hang on safari/firefox and will not load Google, Apple, Facebook etc., only occasionly will it work. When it works, it works fast with my 17Mbps connection. In addition I will get 50 ping failures to the Exchnage box, maybe 4 succesful pings, then another 20 failures. No pattern, but I would say 90% failures, 10% successfulls
    - At the time when it does not connect, I am not able to ping the websites mentioned, host not found or if the host is cached, it will show ping failures to that website
    - To further test, I loaded Windows 7 on VMware Fusion with Unity mode. I had the Windows command prompt right next to the Mac terminal. ping -t google.com from command prompt will ping succesfully, no failures, at the same time we get 90-100% failures on the Mac side
    So I called up AppleCare, the agent suggested to rename /Library/Prefrences/SystemConfiguration/ to SystemConfigurationOld. After restart we get 10% failures with ping to the Exchnage and above mentioned site. After 10 mins, it goes back to the above behaviour with 90-100% failure. The whole time the Windows 7 side works fine, as well as iPhone, iPad and IBM work laptop.
    AppleCare escalated to senior engineer. We restarted with the option key and booted in to the 10.8 version of recovery partition. Same issue with safari where it will hang on the websites, only occasionally work. We then restarted to internet recovery partition which loaded 10.7 recovery as the MBA was originally 10.7. From 10.7 recovery, there are NO issues. Websites load 100% of the time and pings to the Exchange server as well as google.com etc 100% successful. Senior enginner has escalted to US engineer (I'm guessing a dev) and I'm waiting for a call back).
    I'm tempted to revert back to 10.7, but this really needs to be addressed.

    I'm also seeing this issue on my Macbook Air 11" mid 2012 with OSX 10.8.3.
    I've had several calls to Apple support and we went through the same things as you mention to no avail but now they tell me to just take it in for hardware diags.
    I'm seeing upwards of 20% loss of pings to a local host but interestingly when I simultaneously ping the MBA from that host on my network it always works.  When I run Wireshark or the internal sniffer on the MBA it shows no returning ICMP reply.
    I've tried running Linux in Virtualbox and it works perfectly all the time.
    I'd be very interested to hear how/if you resolved the issue.

  • BUG: Face recognition data not saved to images.

    i have the option to automatically save XMP data into the images activated.
    so all keywords and metadata changes are not only saved to the catalog but also into my DNG and TIFF images.
    now this works fine for everything except the new face recognition data.
    i mean the areas (rectangles) where the faces are.
    i guess the problem is that the images already contain the keywords (names) of the persons in the images.
    what i did was using the rectangles to identify the persons in the images. drawing rectangles around their faces and name them.
    this info about the rectangle positions is NOT automatically stored in the image files. not after hours of letting LR run idle.
    this info is only stored when i manually save (CTRL+S) the images or do something other to the metadata (like adding NEW keywords to it).
    so in short:  just adding the face region data (the rectangles) will not trigger the automatic XMP save function when the name keyword was already asigned as keyword to the image.
    that´s very bad and must considered a bug in my opinion..
    i don´t like to rely on the LR catalog only. it´s unsave even with backups.
    i want that the metadata info is stored in the images.
    also when i give away my images i want that the metadata is in the images.
    that´s why "automatically save XMP" is always active and very important for me.

    I don't have any info but repost your original info at this site.  Supposedly Adobe reads this and it should not get lost in the clutter  I have posted a few bugs there and they were acknowledged but not fixed but Adobe seems to be pretty good at fixing potential data loss bugs/problems which I consider this to be if it is working as you describe.
    Photoshop Family Customer Community

  • AIR Updater bombs on Initialize()

    In Flex 3 I used this code to setup my AIR updater:
    _updater = new ApplicationUpdaterUI();
    _updater.updateURL = "...";
    _updater.isCheckForUpdateVisible = false;
    _updater.addEventListener(UpdateEvent.INITIALIZED, checkForUpdate);
    _updater.addEventListener(ErrorEvent.ERROR, onError);
    _updater.initialize();
    With Flex 4, calling the final initialize() function results in this error:
    TypeError: Error #1007: Instantiation attempted on a non-constructor.
        at mx.preloaders::Preloader/initialize()[E:\dev\trunk\frameworks\projects\framework\src\mx\p reloaders\Preloader.as:253]
        at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::initialize()[E:\dev\trunk\frameworks\projects\ framework\src\mx\managers\SystemManager.as:1920]
        at mx.managers::SystemManager/initHandler()[E:\dev\trunk\frameworks\projects\framework\src\m x\managers\SystemManager.as:2414]
    Is there something new I need to do in Flex 4 to handle AIR updates?  I read the livedocs for the ApplicationUpdaterUI and it appears to be the same as Flex 3.
    Thanks!

    I encountered this too, but the problem seems to have been fixed in recent nightly builds. I don't when it was fixed exactly, but SDK 13729 works fine for me.
    If you don't want to use a nightly build, there is a third-party solution available here:
    http://www.websector.de/blog/2009/09/09/custom-applicationupdaterui-for-using-air-updater- framework-in-flex-4/

  • Deserialization works only in debug mode

    When I try to deserialize an XML document (defined via File-Connection) it works fine in debug mode but I get an error in non-debug-mode. What's the problem here?
    Error: 2011-12-29 19:31:40.25
    Code: 0x00000001
    Source: Read data from SAP
    Description: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: There is an error in X
    ML document (0, 0). ---> System.TypeInitializationException: The type initializer for 'Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderList1' threw an exception
    . ---> System.NullReferenceException: Object reference not set to an instance of an object.
    at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderList1..cctor()
    --- End of inner exception stack trace ---
    at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderList1..ctor()
    at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializerContract.get_Reader()
    at System.Xml.Serialization.TempAssembly.InvokeReader(XmlMapping mapping, XmlReader xmlReader, XmlDeserializationEvents events, String encodingStyle)
    at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
    --- End of inner exception stack trace ---
    at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
    at System.Xml.Serialization.XmlSerializer.Deserialize(TextReader textReader)

    Yes, there is a potential for a bug. Thus, feel free to log it in
    MS Connect.
    You need to deploy it to the GAC, too. I will better point you to a blog post that covers this: http://www.hoekstra.co.uk/index.php/software-mainmenu-36/ssis-mainmenu-75/73-create-and-use-a-c-assembly-for-ssis.html?start=1
    I suggest when you go live you create a script that will take care of all, but it is not too too laborious.
    Arthur My Blog
    Are you 100% sure? Because I can see that SSIS seeks for the dll in ...DTS/binn. So I see no need to pollute the GAC with this dll.
    My dll is not deployed into the GAC and when I remove it, it will no longer work. I think it works in DTS/binn because the DTExec.exe is located there?
    LOG: This bind starts in default load context.
    LOG: Using application configuration file: c:\Program Files\Microsoft SQL Server\100\DTS\binn\DTExec.exe.Config
    LOG: Using machine configuration file from c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
    LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
    LOG: Attempting download of new URL file:///c:/Program Files/Microsoft SQL Server/100/DTS/binn/ClassLibrary1.DLL.
    LOG: Attempting download of new URL file:///c:/Program Files/Microsoft SQL Server/100/DTS/binn/ClassLibrary1/ClassLibrary1.DLL.
    LOG: Attempting download of new URL file:///c:/Program Files/Microsoft SQL Server/100/DTS/binn/ClassLibrary1.EXE.
    LOG: Attempting download of new URL file:///c:/Program Files/Microsoft SQL Server/100/DTS/binn/ClassLibrary1/ClassLibrary1.EXE.

  • Title text disappearing between sessions

    One of the genuinely annoying, and potentially job-threatening, bugs in FCP X is this:
    When working on a project with title text (lower thirds, text on screen, title slides, end credits, etc) the customized text will often just clear out between FCP X sessions. For example, I have a project with a title slide (created from one of the standard title generators) that says "Barcelona Revitalization - Public Private Partnerships." I dress the text up just so then go on about my editing. Tomorrow, I may re-open the project, change one video clip, then export again for the client EXCEPT that a quick scan of the video reveals that the text box of the opening slide now, inexplicably, says "Title Text Here" with no remnants of my former text.  This happens frequently enough that I have to scan EVERY text slide each time I export a file to avoid a big embarrassment. I have nearly exported final drafts of videos for clients with "Title Here" for the main interviewee's name on more than one occasion. Note that it only happens when FCP is quit then restarted, and has no other predictable pattern.
    It's a terrible bug, and I need a workaround that I can be confident about. Why does this happen and what can I do? Am I the only one?

    Only you and several thousand others...
    I'm not sure there's a definite workaround for this other than to work in small segments then close FCPX. Re-open and work on another small segment, then close....etc.
    This is one they haven't been able to fix after two incremental upgrades.

  • Deleting the first word in a string

    hi! i'm learning regex and with this code i would like to
    1) print a string (from "Hi my name is SandraPandra. do not print this")
    2) remove the first word and print the new, shorter string
    3) remove the first word in the new, shorter string and print the newer and shorter string
    4) continue this until it hits a non-character (e.g period, colon, quotation marks etc)
    does anyone here know how i should change my code in order to achieve this?
    here's my code:
    class Testar {
    public static void main(String[] args) {
          String partDesc = "Hi my name is SandraPandra. do not print this.";
          do {
               System.out.println(partDesc);
              partDesc = partDesc.replaceFirst("^(\\w+)\\s+","");}
              while (partDesc.equals("\\w") == true);
               if (partDesc.equals("\\w") == false){  //this is where something goes wrong
              System.out.println("found a full stop!");}
    } the outcome now is:
    Hi my name is SandraPandra. do not print this.
    found a full stop!
    Thank you in advance!

    I answered this question in your previous thread. (Sorry, I didn't realize "I'm going to bed now" was a code for "I won't be reading this thread any more". ^_^ )
    I would also like to point out that it's bad form to write conditions like   if ( booleanExpression == true ) It's gratuitously verbose, and it creates the potential for subtle bugs. Suppose the boolean expression is a non-final boolean variable, and you accidentally leave out one of the equals signs:   if ( booleanVariable = true ) An assignment statement evaluates to the value that was assigned, so this "condition" will always be true.

  • Aperture can't find photos on SD card from Canon XSi

    Aperture 2.1.1 can't seem to find any photos on an SD card from a Canon Rebel XSi when I try to Import from the card, which is in a USB card reader. I could swear that Aperture 2.1 was able to find the photos no problem.
    I had to manually drag all the photos into a folder and import from the folder.

    Ok, I finally figured it out: it's a bug present in both Aperture 2.1 (on a Powerbook G4) and Aperture 2.1.1 (on a 4-core Mac Pro).
    If a) Aperture is not currently running AND b) Aperture is selected as the app to run when a camera is connected AND c) you connect a camera, THEN when Aperture opens, it will go into Import mode, and the GUI will be pointed at the camera, but Aperture will in reality be pointed at some random folder in the file system. The tagline at the top of the window will read: 'Import from "a folder" to a new project.' when it should read 'Import from "Canon EOS Digital Rebel XSi" to a new project.'
    No pictures will be shown for import. A file system column view will be shown, but it will be empty. This is what made me think that the card couldn't be read.
    This bug can be worked around. Moving the "Import" GUI bar to the file system section, then back to the camera, will fix things and allow the camera preview images to start appearing. Also, if Aperture is already running when the camera is first connected, the problem does not occur.
    I don't know if it matters, but I still have the Aperture "splash" screen enabled, which allows you to pick an activity (Import from Camera, Import from Folder, Just start using Aperture, etc.) before the main GUI comes up. This may or may not affect the appearance of the bug.
    I tried the same test with a Nikon P5000 point-and-shoot, and saw the same behavior (i.e. the same bug), so it doesn't appear to depend on any peculiarities of the camera firmware. It's just an out-and-out initialization bug.

  • CS4 "corrupt" file?

    I have a file that was created about a month ago. I printed it (Epson 2400) and everything was perfect. Last week, I re-opened the file and printed it and the print was horrible; it looked faded. Everything looked fine on the screen. Nothing has changed. Opened and printed other files that were created at the same time and they're fine.
    I ended up creating a new Illustrator file, copying the layers from the original file into the new file (via copy and paste) and to my surprise, the print was right on. This leads me to believe that something happened to the original file but I don't get an error message or any indication of a problem other than the print. Both files are CMYK with the same profile.
    If anyone could shed some light on this, I'd appreciate it.
    Thanks in advance,
    -Ilene

    If you look at Photoshop updates, you will see a lot updates (for CS2, CS3, CS4, etc.), but Illustrator have not provide a single update for almost 3 years. And Illustrator versions have very serious and critical bugs.
    Well, I'm not the greatest AI user, but I don't really see it this way. A lot of what you encounter as bugs, I couldn't care less about. That's just the curse of how what specific work we do, influences our perception of a tool. Example: If I had my sayso, we'd gotten rid of "useless junk" like the chart tools (that really only produce charts that make Mr. Tufte shudder) long ago - one portion of code less to maintain and one less potential point for bugs. Yet, others use them all the time and they even have some creative uses. In reverse, I'm craving for consistent CAD tools, as it would help me to prepare my 3D content when I do visualisations. But dilge - nothing really there and until this day AI can't do a proper fillet without help from scripts or plug-ins.
    Similar comparisons can be made fo a million other tools and that's where things get extremely foggy - both from users and the developers. Simply put: Whenever a feature is added in response to feature requests, it takes away resources from other tasks and at some point you have so many loose ends, you can't untangle them all. So by all rights, the dev team may have the will, just not enough resources. On the other hand - if you developed a tool without responding to external input, it may represent the perfect realisation of a programmer's "vision" - for a while. As the user's skills and needs evolve, the tool would become less attractive and finally fall off the truck. That part, I'm sure even you would admit, is why, if AI followed such a rigid routine, you and I and otehrs would have stopped using it years ago. So all in all, still someone has to make the hard decisions of what "bad" old stuff gets fixed while new things are added.
    The whole thing is certainly not easier when working in a big company that produces many, many programs. You see, isn't it great that you can import or export Photoshop files, Flash content and PDfs from Illustrator? But doesn't that also mean, that the AI team are dependent on the other teams responsible for those components? Does that not hinder going faster on their end? Imagine, if one of those things needs updating and it doesn't get greenlit simply because it isn't ready yet! Something as essential to Adobe products as support for the PSD format not working could delay the entire release of all otehr programs, not just Photoshop.
    One more thing you should consider, is that actually most Adobe apps are very, very old. In fact, Illustrator was the program that laid the foundation for the company's development as a business along with some other things. Because of the age, it has aquired "bad habits" long before people like me even used it. In addition, along the way as features were added, this was often done by acquiring external code by ways of plug-ins or hiring a specific developer, and neither you nor I really know the licensing legalese that brings with it. While you can assume that the code has been rewritten to more modern standards a few times (after all, we no longer use Windows 3.1 or MacOS 7), the licensing stuff may prevent the code from being modified in certain ways. Effectively a feature may be "locked" into a given state and unless someone comes up with a way to completely replace it without losing functionality, it has to be used that way to comply with the legal agreements.
    My complaint is that Illustrator team doest not care to fix Critical bugs (like the CS4 memory bug, or problems handling photos, etc, etc.)
    Trust me, they certainly do care, but as per the above, there are limits as to what they may be able to do and what they are willing to do. You should also note, that how critical a bug is, is not determined by its visible sideeffects. Especially memory problems tend to be very specific and if they cannot be clearly reproduced, they tend to fall off the lists very quickly. In that case one would often simply assume a combination of system-specific issues with otehr software, hardware and perhaps insufficient configuration.
    Plus we should ask why Photoshop team can accomplish a lot more than the Ai team?
    Do you really think? I don't feel that way at all. Beyond the fact, that the Photoshop team is at least 5 times as large as the Illustrator team, but the program also has a 5 times as large user base (everyone uses PS in one way or the other) and thus may be 5 times as complex to maintain, I don't really see how they achieve "more". Photoshop suffers from the same problems as AI - it's based on an outdated concept of how image processing should be done and is full of legacy features, half-finished "new" features that have just been plugged on and serious frakk-ups. You know, I could start from A and go to Z and come up with an issue for every letter. The most remarkable ones that immediately spring to mind being the network printer issue that plagued CS3, which is unforgivable, to the OpenGL stuff introduced in CS4, that often doesn't work or imposes silly limitations like things becoming awfully slow with a given number of images open. It's great when it works, but I can understand anyone who would want to send gift-wrapped hand grenades to some of the developers when it doesn't. They do some things right like trying to get rid of modal dialogs and using panels instead, but they do just as much wrong with those same panels and many other features.
    Regardless, in the end, there is only one truth here: On balance, PS just works for a majority of the clientel and for a vendor of commercial software that is the decisive factor. The same can be said for Illustrator and that pretty much covers all the options. We can discuss this for a month and not come to a solution that will satisfy all sides. You just have to learn to live with it. It's their loss if they don't listen and, on the other hand, we're off the hook when something goes wrong. Still, it doesn't stop me from filing bugs and making noise in some places and that is the one thing I would ask you to do as well: Retain your critical attitude toward these things, but try to to be a bit more constructive and not so quick to judge. You won't get anyone from Adobe to confirm or deny any of this officially, but they surely monitor these forums and take notes. If phrased properly, they will listen.
    Mylenium
    P.S.: For more on software development, also check my ponderings on my personal blog like this for instance.

  • Change character set

    Hi
    is anyone can tell me how to change characterset.
    i try with alter session but it doesnt work.
    thanks

    Article from Metalink
    Doc ID:      Note:66320.1
    Subject:      Changing the Database Character Set or the Database National Character Set
    Type:      BULLETIN
    Status:      PUBLISHED
         Content Type:      TEXT/PLAIN
    Creation Date:      23-OCT-1998
    Last Revision Date:      12-DEC-2003
    PURPOSE ======= To explain how to change the database character set or national character set of an existing Oracle8(i) or Oracle9i database without having to recreate the database. 1. SCOPE & APPLICATION ====================== The method described here is documented in the Oracle 8.1.x and Oracle9i documentation. It is not documented but it can be used in version 8.0.x. It does not work in Oracle7. The database character set is the character set of CHAR, VARCHAR2, LONG, and CLOB data stored in the database columns, and of SQL and PL/SQL text stored in the Data Dictionary. The national character set is the character set of NCHAR, NVARCHAR2, and NCLOB data. In certain database configurations the CLOB and NCLOB data are stored in the fixed-width Unicode encoding UCS-2. If you are using CLOB or NCLOB please make sure you read section "4. HANDLING CLOB AND NCLOB COLUMNS" below in this document. Before changing the character set of a database make sure you understand how Oracle deals with character sets. Before proceeding please refer to [NOTE:158577.1] "NLS_LANG Explained (How Does Client-Server Character Conversion Work?)". See also [NOTE:225912.1] "Changing the Database Character Set - an Overview" for general discussion about various methods of migration to a different database character set. If you are migrating an Oracle Applications instance, read [NOTE:124721.1] "Migrating an Applications Installation to a New Character Set" for specific steps that have to be performed. If you are migrating from 8.x to 9.x please have a look at [NOTE:140014.1] "ALERT: Oracle8/8i to Oracle9i Using New "AL16UTF16"" and other referenced notes below. Before using the method described in this note it is essential to do a full backup of the database and to use the Character Set Scanner utility to check your data. See the section "2. USING THE CHARACTER SET SCANNER" below. Note that changing the database or the national character set as described in this document does not change the actual character codes, it only changes the character set declaration. If you want to convert the contents of the database (character codes) from one character set to another you must use the Oracle Export and Import utilities. This is needed, for example, if the source character set is not a binary subset of the target character set, i.e. if a character exists in the source and in the target character set but not with the same binary code. All binary subset-superset relationships between characters sets recognized by the Oracle Server are listed in [NOTE:119164.1] "Changing Database Character Set - Valid Superset Definitions". Note: The varying width character sets (like UTF8) are not supported as national character sets in Oracle8(i) (see [NOTE:62107.1]). Thus, changing the national character set from a fixed width character set to a varying width character set is not supported in Oracle8(i). NCHAR types in Oracle8 and Oracle8i were designed to support special Oracle specific fixed-width Asian character sets, that were introduced to provide higher performance processing of Asian character data. Examples of these character sets are : JA16EUCFIXED ,JA16SJISFIXED , ZHT32EUCFIXED. For a definition of varying width character sets see also section "4. HANDLING CLOB AND NCLOB COLUMNS" below. WARNING: Do not use any undocumented Oracle7 method to change the database character set of an Oracle8(i) or Oracle9i database. This will corrupt the database. 2. USING THE CHARACTER SET SCANNER ================================== Character data in the Oracle 8.1.6 and later database versions can be efficiently checked for possible character set migration problems with help of the Character Set Scanner utility. This utility is included in the Oracle Server 8.1.7 software distribution and the newest Character Set Scanner version can be downloaded from the Oracle Technology Network site, http://otn.oracle.com The Character Set Scanner on OTN is available for limited number of platforms only but it can be used with databases on other platforms in the client/server configuration -- as long as the database version matches the Character Set Scanner version and platforms are either both ASCII-based or both EBCDIC-based. It is recommended to use the newest Character Set Scanner version available from the OTN site. The Character Set Scanner is documented in the following manuals: - "Oracle8i Documentation Addendum, Release 3 (8.1.7)", Chapter 3 - "Oracle9i Globalization Support Guide, Release 1 (9.0.1)", Chapter 10 - "Oracle9i Database Globalization Support Guide, Release 2 (9.2)", Chapter 11 Note: The Character Set Scanner coming with Oracle 8.1.7 and Oracle 9.0.1 does not have a separate version number. It reports the database release number in its banner. This version of the Scanner does not check for illegal character codes in a database if the FROMCHAR and TOCHAR (or FROMNCHAR and TONCHAR) parameters have the same value (i.e. you simulate migration from a character set to itself). The Character Set Scanner 1.0, available on OTN, reports its version number as x.x.x.1.0, where x.x.x is the database version number. This version adds a few bug fixes and it supports FROMCHAR=TOCHAR provided it is not UTF8. The Character Set Scanner 1.1, available on OTN and with Release 2 (9.2) of the Oracle Server, reports its version number as v1.1 followed by the database version number. This version adds another bug fixes and the full support for FROMCHAR=TOCHAR. None of the above versions of the Scanner can correctly analyze CLOB or NCLOB values if the database or the national character set, respectively, is multibyte. The Scanner reports such values randomly as Convertible or Lossy. The version 1.2 of the Scanner will mark all such values as Changeless (as they are always stored in the Unicode UCS-2 encoding and thus they do not change when the database or national character set is changed from one multibyte to another). Character Set Scanner 2.0 will correctly check CLOBs and NCLOBs for possible data loss when migrating from a multibyte character set to its subset. To verify that your database contains only valid codes, specify the new database character set in the TOCHAR parameter and/or the new national character set in the TONCHAR parameter. Specify FULL=Y to scan the whole database. Set ARRAY and PROCESS parameters depending on your system's resources to speed up the scanning. FROMCHAR and FROMNCHAR will default to the original database and national character sets. The Character Set Scanner should report only Changless data in both the Data Dictionary and in application data. If any Convertible or Exceptional data are reported, the ALTER DATABASE [NATIONAL] CHARACTER SET statement must not be used without further investigation of the source and type of these data. In situations in which the ALTER DATABASE [NATIONAL] CHARACTER SET statement is used to repair an incorrect database character set declaration rather than to simply migrate to a new wider character set, you may be advised by Oracle Support Services analysts to execute the statement even if Exceptional data are reported. For more information see also [NOTE:225912.1] "Changing the Database Character Set - a short Overview". 3. CHANGING THE DATABASE OR THE NATIONAL CHARACTER SET ====================================================== Oracle8(i) introduces a new documented method of changing the database and national character sets. The method uses two SQL statements, which are described in the Oracle8i National Language Support Guide: ALTER DATABASE [<db_name>] CHARACTER SET <new_character_set> ALTER DATABASE [<db_name>] NATIONAL CHARACTER SET <new_NCHAR_character_set> The database name is optional. The character set name should be specified without quotes, for example: ALTER DATABASE CHARACTER SET WE8ISO8859P1 To change the database character set perform the following steps. Note that some of them have been erroneously omitted from the Oracle8i documentation: 1. Use the Character Set Scanner utility to verify that your database contains only valid character codes -- see "2. USING THE CHARACTER SET SCANNER" above. 2. If necessary, prepare CLOB columns for the character set change -- see "4. HANDLING CLOB AND NCLOB COLUMNS" below. Omitting this step can lead to corrupted CLOB/NCLOB values in the database. If SYS.METASTYLESHEET (STYLESHEET) is populated (9i and up only) then see [NOTE:213015.1] "SYS.METASTYLESHEET marked as having convertible data (ORA-12716 when trying to convert character set)" for the actions that need to be taken. 3. Make sure the parallel_server parameter in INIT.ORA is set to false or it is not set at all. 4. Execute the following commands in Server Manager (Oracle8) or sqlplus (Oracle9), connected as INTERNAL or "/ AS SYSDBA": SHUTDOWN IMMEDIATE; -- or NORMAL <do a full database backup> STARTUP MOUNT; ALTER SYSTEM ENABLE RESTRICTED SESSION; ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0; ALTER SYSTEM SET AQ_TM_PROCESSES=0; ALTER DATABASE OPEN; ALTER DATABASE CHARACTER SET <new_character_set>; SHUTDOWN IMMEDIATE; -- OR NORMAL STARTUP RESTRICT; 5. Restore the parallel_server parameter in INIT.ORA, if necessary. 6. Execute the following commands: SHUTDOWN IMMEDIATE; -- OR NORMAL STARTUP; The double restart is necessary in Oracle8(i) because of a SGA initialization bug, fixed in Oracle9i. 7. If necessary, restore CLOB columns -- see "4. HANDLING CLOB AND NCLOB COLUMNS" below. To change the national character set replace the ALTER DATABASE CHARACTER SET statement with ALTER DATABASE NATIONAL CHARACTER SET. You can issue both statements together if you wish. Error Conditions ---------------- A number of error conditions may be reported when trying to change the database or national character set. In Oracle8(i) the ALTER DATABASE [NATIONAL] CHARACTER SET statement will return: ORA-01679: database must be mounted EXCLUSIVE and not open to activate - if you do not enable restricted session - if you startup the instance in PARALLEL/SHARED mode - if you do not set the number of queue processes to 0 - if you do not set the number of AQ time manager processes to 0 - if anybody is logged in apart from you. This error message is misleading. The command requires the database to be open but only one session, the one executing the command, is allowed. For the above error conditions Oracle9i will report one of the errors: ORA-12719: operation requires database is in RESTRICTED mode ORA-12720: operation requires database is in EXCLUSIVE mode ORA-12721: operation cannot execute when other sessions are active Oracle9i can also report: ORA-12718: operation requires connection as SYS if you are not connect as SYS (INTERNAL, "/ AS SYSDBA"). If the specified new character set name is not recognized, Oracle will report one of the errors: ORA-24329: invalid character set identifier ORA-12714: invalid national character set specified ORA-12715: invalid character set specified The ALTER DATABASE [NATIONAL] CHARACTER SET command will only work if the old character set is considered a binary subset of the new character set. Oracle Server 8.0.3 to 8.1.5 recognizes US7ASCII as the binary subset of all ASCII-based character sets. It also treats each character set as a binary subset of itself. No other combinations are recognized. Newer Oracle Server versions recognize additional subset/superset combinations, which are listed in [NOTE:119164.1]. If the old character set is not recognized as a binary subset of the new character set, the ALTER DATABASE [NATIONAL] CHARACTER SET statement will return: - in Oracle 8.1.5 and above: ORA-12712: new character set must be a superset of old character set - in Oracle 8.0.5 and 8.0.6: ORA-12710: new character set must be a superset of old character set - in Oracle 8.0.3 and 8.0.4: ORA-24329: invalid character set identifier You will also get these errors if you try to change the characterset of a US7ASCII database that was started without a (correct) ORA_NLSxx parameter. See [NOTE:77442.1] It may be necessary to switch off the superset check to allow changes between formally incompatible character sets to solve certain character set problems or to speed up migration of huge databases. Oracle Support Services may pass the necessary information to customers after verifying the safety of the change for the customers' environments. If in Oracle9i an ALTER DATABASE NATIONAL CHARACTER SET is issued and there are N-type colums who contain data then this error is returned: ORA-12717:Cannot ALTER DATABASE NATIONAL CHARACTER SET when NCLOB data exists The error only speaks about Nclob but Nchar and Nvarchar2 are also checked see [NOTE:2310895.9] for bug [BUG:2310895] 4. HANDLING CLOB AND NCLOB COLUMNS ================================== Background ---------- In a fixed width character set codes of all characters have the same number of bytes. Fixed width character sets are: all single-byte character sets and those multibyte character sets which have names ending with 'FIXED'. In Oracle9i the character set AL16UTF16 is also fixed width. In a varying width character set codes of different characters may have different number of bytes. All multibyte character sets except those with names ending with FIXED (and except Oracle9i AL16UTF16 character set) are varying width. Single-byte character sets are character sets with names of the form xxx7yyyyyy and xxx8yyyyyy. Each character code of a single-byte character set occupies exactly one byte. Multibyte character sets are all other character sets (including UTF8). Some -- usually most -- character codes of a multibyte character set occupy more than one byte. CLOB values in a database whose database character set is fixed width are stored in this character set. CLOB values in an Oracle 8.0.x database whose database character set is varying width are not allowed. They have to be NULL. CLOB values in an Oracle >= 8.1.5 database whose database character set is varying width are stored in the fixed width Unicode UCS-2 encoding. The same holds for NCLOB values and the national character set. The UCS-2 storage format of character LOB values, as implemented in Oracle8i, ensures that calculation of character positions in LOB values is fast. Finding the byte offset of a character stored in a varying width character set would require reading the whole LOB value up to this character (possibly 4GB). In the fixed width character sets the byte offsets are simply character offsets multiplied by the number of bytes in a character code. In UCS-2 byte offsets are simply twice the character offsets. As the Unicode character set contains all characters defined in any other Oracle character set, there is no data loss when a CLOB/NCLOB value is converted to UCS-2 from the character set in which it was provided by a client program (usually the NLS_LANG character set). CLOB Values and the Database Character Set Change ------------------------------------------------- In Oracle 8.0.x CLOB values are invalid in varying width character sets. Thus you must delete all CLOB column values before changing the database character set to a varying width character set. In Oracle 8.1.5 and later CLOB values are valid in varying width character sets but they are converted to Unicode UCS-2 before being stored. But UCS-2 encoding is not a binary superset of any other Oracle character set. Even codes of the basic ASCII characters are different, e.g. single-byte code for "A"=0x41 becomes two-byte code 0x0041. This implies that even if the new varying width character set is a binary superset of the old fixed width character set and thus VARCHAR2/LONG character codes remain valid, the fixed width character codes in CLOB values will not longer be valid in UCS-2. As mentioned above, the ALTER DATABASE [NATIONAL] CHARACTER SET statement does not change character codes. Thus, before changing a fixed width database character set to a varying width character set (like UTF8) in Oracle 8.1.5 or later, you first have to export all tables containing non-NULL CLOB columns, then truncate these tables, then change the database character set and, finally, import the tables back to the database. The import step will perform the required conversion. If you omit the steps above, the character set change will succeed in Oracle8(i) (Oracle9i disallows the change in such situation) and the CLOBs may appear to be correctly legible but as their encoding is incorrect, they will cause problems in further operations. For example, CREATE TABLE AS SELECT will not correctly copy such CLOB columns. Also, after installation of the 8.1.7.3 server patchset the CLOB columns will not longer be legible. LONG columns are always stored in the database character set and thus they behave like CHAR/VARCHAR2 in respect to the character set change. BLOBs and BFILEs are binary raw datatypes and their processing does not depend on any Oracle character set setting. NCLOB Values and the National Character Set Change -------------------------------------------------- The above discussion about changing the database character set and exporting and importing CLOB values is theoretically applicable to the change of the national character set and to NCLOB values. But as varying width character sets are not supported as national character sets in Oracle8(i), changing the national character set from a fixed width character set to a varying width character set is not supported at all. Preparing CLOB Columns for the Character Set Change --------------------------------------------------- Take a backup of the database. If using Advanced Replication or deferred transactions functionality, make sure that there are no outstanding deferred transactions with CLOB parameters, i.e. DEFLOB view must have no rows with non-NULL CLOB_COL column; to make sure that replication environment remains consistent use only recommended methods of purging deferred transaction queue, preferably quiescing the replication environment. Then: - If changing the database character set from a fixed width character set to a varying with character set in Oracle 8.0.x, set all CLOB column values to NULL -- you are not allowed to use CLOB columns after the character set change. - If changing the database character set from a fixed width character set to a varying width character set in Oracle 8.1.5 or later, perform table-level export of all tables containing CLOB columns, including SYSTEM's tables. Set NLS_LANG to the old database character set for the Export utility. Then truncate these tables. Restoring CLOB Columns after the Character Set Change ----------------------------------------------------- In Oracle 8.1.5 or later, after changing the character set as described above (steps 3. to 6.), restore CLOB columns exported in step 2. by importing them back into the database. Set NLS_LANG to the old database character set for the Import utility to avoid IMP-16 errors and data loss. RELATED DOCUMENTS: ================== [NOTE:13856.1] V7: Changing the Database Character Set -- This note has limited distribution, please contact Oracle Support [NOTE:62107.1] The National Character Set in Oracle8 [NOTE:119164.1] Changing Database Character set - Valid Superset definitions [NOTE:118242.1] ALERT: Changing the Database or National Character Set Can Corrupt LOB Values <Note.158577.1> NLS_LANG Explained (How Does Client-Server Character Conversion Work?) [NOTE:140014.1] ALERT: Oracle8/8i to Oracle9i using New "AL16UTF16" [NOTE:159657.1] Complete Upgrade Checklist for Manual Upgrades from 8.X / 9.0.1 to Oracle9i (incl. 9.2) [NOTE:124721.1] Migrating an Applications Installation to a New Character Set Oracle8i National Language Support Guide Oracle8i Release 3 (8.1.7) Readme - Section 18.12 "Restricted ALTER DATABASE CHARACTER SET Command Support (CLOB and NCLOB)" Oracle8i Documentation Addendum, Release 3 (8.1.7) - Chapter 3 "New Character Set Scanner Utility" Oracle8i Application Developer's Guide - Large Objects (LOBs), Release 2 - Chapter 2 "Basic Components" Oracle8 Application Developer's Guide, Release 8.0 - Chapter 6 "Large Objects (LOBs)", Section "Introduction to LOBs" Oracle9i Globalization Guide, Release 1 (9.0.1) Oracle9i Database Globalization Guide, Release 2 (9.2) For further NLS / Globalization information you may start here: [NOTE:150091.1] Globalization Technology (NLS) Library index .
         Copyright (c) 1995,2000 Oracle Corporation. All Rights Reserved. Legal Notices and Terms of Use.     
    Joel P�rez

  • Read-only radiogroup with default doesn't save state in 2.0

    Hi,
    I upgraded to HTMLDB 2.0 and noticed a change in behavior. Namely, when I have a read-only radio group with a default value and a not-null validation, the validation claims fails although a radio button is selected from the disabled radio group.
    Here's a small app I generated to demonstrate the issue:
    http://htmldb.oracle.com/pls/otn/f?p=34464
    Go there and try to create a new EMP.
    The only things added after the generation are:
    1. Not-null validations on several of the fields
    2. Changed MGR to a "Select List"
    3. Changed DEPTNO to a radio group with these properties:
    a) default value type: static; default value: 20
    b) read-only when: P2_EMPNO is Null
    This used to work fine in 1.6 - namely, the default value got it to the session state and consequently the validation succeeded and the new record was created with the default value.
    It also works fine if the Radio Group is not read-only.
    I was able to fix the problem by adding a calculation to the P2_DEPTNO item to set the default value there. This of course does not show the default on the form for the new record, so I had to keep the default on the item level as well - which is a potential source of bugs when those two defaults somehow get different values (e.g., when I change only one of them and forget about the other) - the user will see one thing displayed while another will be saved. So any solutions involving keeping the default value on only one place AND visible to the end user when creating new records are welcome.
    I haven't had time yet to test with other item types - maybe next week...
    Have a nice weekend!
    Flado

    Scott,
    Yes, in 1.6 this used to work fine - the radiogroup was displayed as disabled, and the default value was selected, and the not-null validation succeeded, and all I did was set the default value of the radiogroup. I have no 1.6 environment anymore to test it, but I'm sure it was working, because after I upgraded to 2.0, it stopped working and I got a bug report from a user very, very quickly :-(.
    By "adding a calculation to the P2_DEPTNO item" I mean "adding a computation of the P2_DEPTNO item to the page". Sorry about me being lazy here. It was (still is, in my production application) a conditional after-submit computation (if <primary key item> is null, set <radiogroup item> to <default value>)
    Thank you for the suggestion. I implemented it in the demo app. What I did was:
    1. remove the default value from P2_DEPTNO
    2. Add an unconditional after-header computation that assigns P2_DEPTNO with the static value 20
    I am able to create new EMPs now, but nothing is selected in the disabled radiogroup on the create page, although the value 20 is saved in the session state before the items are rendered, according to the debug info (you can try it out and see).
    To recap, I still need to keep the default value in two places: default of the radiogroup (to get it displayed on the create form), and in a computation (to set the session state).
    Cheers,
    Flado

Maybe you are looking for

  • RE Camera And Camera App

    The Re Camera is an Attachment like a GO PRO camera, From  H.T.C. the  App  for this Camera is Now Available in Google Play. Enjoy.. http://www.droid-life.com/2014/11/04/re-camera-companion-app-available-in-google-play/ RE - Android Apps on Google Pl

  • Can't empty trash in Finder

    Hey out there! I can't seem to empty trash in Finder (Mt. Lion). It starts deleting 45k items, and then simply quits.  I deleted a whole slew of apps and files which were transferred from my really OLD iMac.  Did I overload it's capacity? Thank you s

  • Previous page had this: Common Questions What happened to the Status Bar? t you start with telling us What is the Add-on Bar? How do I use bookmarks? What are App Tabs? How do I customize the toolbars?

    Don't assume people automatically know all your technical terms! Before you talk about, e.g., "status bar", it would be really helpful to show or tell us WHERE IT IS. Since you made basic things like "history" and "bookmarks" harder to find, I'm back

  • Web Server Issue

    Guys, I am facing a little problem related to Apache Web Server. When we configured Reporting and Analysis tool, the results showed Web server as succeded. But i could not see Apache in the services list and hence could not start. As a result i am ge

  • My Computer Shut off and will not turn back on

    Last night i was lying on my bed when suddenly my laptop shut off without any notice. Now i cannot get it to turn back on and the only thing i notice that tells me it's not dead is the light when i plug the charger in. I've tried taking the battery o