Workaround for LineBreakMeasurer thread safety issues?

Basically, we have a servlet that returns a png in response to a GET request containing a String, and info on the font, size, size of area the text needs to fit in, and color to render it in. Periodically the webserver locks up as requests get stuck in the servlet!
After digging around, I found out that Graphics 2D ops are safe, as long as each thread has it's own instance. No problem there!
The problem is, we want to break the string, and make it fit inside the area given. And it turns out, LineBreakMeasurer eventually calls the method getEngine() on SunLayoutEngine, and threads lock up in there.
Here's the code from SUN:
SunLayoutEngine extract listed below
public final class SunLayoutEngine implements LayoutEngine, LayoutEngineFactory {
    private static native void initGVIDs();
    static {
     initGVIDs();
    private LayoutEngineKey key;
    private static LayoutEngineFactory instance;
    public static LayoutEngineFactory instance() {
        if (instance == null) {
            instance = new SunLayoutEngine();
        return instance;
    private SunLayoutEngine() {
        // actually a factory, key is null so layout cannot be called on it
    public LayoutEngine getEngine(Font2D font, int script, int lang) {
        return getEngine(new LayoutEngineKey(font, script, lang));
  // !!! don't need this unless we have more than one sun layout engine...
    public LayoutEngine getEngine(LayoutEngineKey key) {
        HashMap cache = (HashMap)cacheref.get();
        if (cache == null) {
            cache = new HashMap();
            cacheref = new SoftReference(cache);
        *HERE IS WHERE WE LOCKUP VVV*
        LayoutEngine e = (LayoutEngine)cache.get(key);
        if (e == null) {
            e = new SunLayoutEngine(key.copy());
            cache.put(key, e);
        return e;
    private SoftReference cacheref = new SoftReference(null);
    private SunLayoutEngine(LayoutEngineKey key) {
        this.key = key;
    public void layout(FontStrikeDesc desc, float[] mat, int gmask,
                       int baseIndex, TextRecord tr, boolean rtl, Point2D.Float pt, GVData data) {
        Font2D font = key.font();
        FontStrike strike = font.getStrike(desc);
        nativeLayout(font, strike, mat, gmask, baseIndex, tr.text, tr.start, tr.limit, tr.min, tr.max, key.script(), key.lang(), rtl, pt, data);
    private static native void nativeLayout(Font2D font, FontStrike strike, float[] mat, int gmask, int baseIndex,
                                            char[] chars, int offset, int limit, int min, int max,
                                            int script, int lang, boolean rtl, Point2D.Float pt, GVData data);
}Even though each thread is using it's own LBM instance, they will often lock up inside SunLayoutEngine.
Note the factory method always returns the same instance, which will be shared by all threads!
I've filed a bug against sun. I am open to any workarounds you may have.
And for those of you using various java based report generators, and getting lockups, I think this may be related. :)
Edited by: djoyce on Oct 16, 2007 2:12 PM
Edited by: djoyce on Oct 16, 2007 2:15 PM

Okay, this class is it's own factory, and only one instance is ever created. GlyphLayout calls instance(), and getEngine on that, and then all the threads pile up in the weakref'd hashmap.
at java.util.HashMap.get(HashMap.java:348)
at sun.font.SunLayoutEngine.getEngine(SunLayoutEngine.java:113)
at sun.font.GlyphLayout$EngineRecord.init(GlyphLayout.java:565)
at sun.font.GlyphLayout.nextEngineRecord(GlyphLayout.java:439)
at sun.font.GlyphLayout.layout(GlyphLayout.java:371)
at sun.font.ExtendedTextSourceLabel.createGV(ExtendedTextSourceLabel.java:267)
at sun.font.ExtendedTextSourceLabel.getGV(ExtendedTextSourceLabel.java:252)
at sun.font.ExtendedTextSourceLabel.createCharinfo(ExtendedTextSourceLabel.java:522)
at sun.font.ExtendedTextSourceLabel.getCharinfo(ExtendedTextSourceLabel.java:451)
at sun.font.ExtendedTextSourceLabel.getLineBreakIndex(ExtendedTextSourceLabel.java:397)
at java.awt.font.TextMeasurer.calcLineBreak(TextMeasurer.java:313)
at java.awt.font.TextMeasurer.getLineBreakIndex(TextMeasurer.java:548)
at java.awt.font.LineBreakMeasurer.nextOffset(LineBreakMeasurer.java:340)
at java.awt.font.LineBreakMeasurer.nextLayout(LineBreakMeasurer.java:422)
at java.awt.font.LineBreakMeasurer.nextLayout(LineBreakMeasurer.java:395)

Similar Messages

  • Thread Safety Issue with DOM

    I am parsing an XML into a DOM object using the Xerces parser that is packaged with JDK 1.5.
    First, I create a new instance of the DocumentBuilderFactory and then using the factory, create a new DocumentBuilder. I then parse the XML using the DocumentBuilder to obtain a DOM object.
    Somehow, I am seeing the same DOM object being used for different XMLs.
    Is there a thread safety issue with the Xerces parser?

    certainly, Xerces parser is not thread safe. You have to provide thread safety by making sure that only one thread is allowed to access DocumentBuilder object.

  • [svn] 4910: Implementing workaround for history manager rendering issue ( Firefox/Mac) caused by a long standing player bug.

    Revision: 4910
    Author: [email protected]
    Date: 2009-02-10 11:51:58 -0800 (Tue, 10 Feb 2009)
    Log Message:
    Implementing workaround for history manager rendering issue (Firefox/Mac) caused by a long standing player bug.
    Bugs: SDK-17020.
    QE Notes: None
    Doc Notes: None
    Reviewer: Alex
    Tests: DeepLinking
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-17020
    Modified Paths:
    flex/sdk/branches/3.x/frameworks/projects/framework/src/mx/managers/BrowserManagerImpl.as
    flex/sdk/branches/3.x/templates/html-templates/client-side-detection-with-history/history /history.js
    flex/sdk/branches/3.x/templates/html-templates/express-installation-with-history/history/ history.js
    flex/sdk/branches/3.x/templates/html-templates/no-player-detection-with-history/history/h istory.js

  • THREAD SAFETY ISSUE OF SERVLET

    It is possible that one instance of a sevlet is accessed by multiple
    client , then how is the concurrency issue taken care of? Especually thread safety?

    It's not, you have to handle it yourself.
    That's why it's a good idea to never put instance variables in servlets. The basic technique is to store anything you need to save between requests in the current user's session (which you get by calling request.getSession()). During a call to service() (or, more frequently, to doGet or doPost, you're safe if you use whatever is present in the request and response argument, including servlet config parameters, request parameters, request attributes, and session attributes.
    If you want to write some "real" servlet app, you should have a look at one of the frameworks, like Jakarta Struts or OpenSymphony WebWorks.

  • SimpleDateFormat thread safety issue

    I have a servlet that instantiates an object of a class for every request in post method, which makes that variable local to that method. This class has "private final DateFormat DOB_FORMAT = new SimpleDateFormat("MM/dd/yyyy");" and a method that calls DOB_FORMAT.parse().
    Even though the instance that has DOB_FORMAT is local we frequently see NumberFormatException on valid dates. So I am wondering if there is a bug/functionality that I am not aware of such that DOB_FORMAT is being shared accross requests. Could somebody advise?

    DrClap wrote:
    From the API documentation for SimpleDateFormat:
    "Date formats are not synchronized. It is recommended to create separate format instances for each thread. If multiple threads access a format concurrently, it must be synchronized externally."Okay, I stand corrected, however, I still think that as long as you are not changing timezones, patterns, etc, that it is safe. I could easily be wrong, though.
    Edit: @OP It might help to see the code in question.

  • This is a workaround for the MBP wireless issue

    There have been many topics on the MBP wireless issues already, but I thought some people might find this workaround helpful.
    Firstly, my system is a 2.2Ghz MBP, running 10.4.10, and also airport extreme update 2007-04. I am using an airport express base station. My previous Powerbook never had any wireless problems, so I really couldn't blame the basestation for the MBPs poor wireless.
    Warning - The workaround requires a little bit of work in the terminal. A little bit of understanding of how networks work is assumed here as well. So it is probably not for everyone ...
    What I have observed - whenever the MBP loses connection, the airport basestation IP and MAC addresses are missing from the ARP table.
    - To view the ARP table, type (in a terminal window) arp -a.
    So, when the MBP wireless hangs, open up the terminal and type that in.
    Do a Cntrl-C if the arp command is hanging and not returning anything.
    In normal situations, a list of IP addresses and MAC addresses will show up.
    As others have already noted, clicking on the airport icon in the menubar, will magically bring the wireless back to life. When this happens, the ARP table also gets magically populated correctly. Coincidence? I think not!
    So, the workaround is to store a PERMANENT entry in the ARP table for the airport basestation IP and MAC address. In my case, I can use the Airport Utility software to confirm what the basestation IP and MAC addresses are (note MAC address = Airport ID in Airport Utility). I found the basestation IP=10.0.1.1 and the MAC=0:11:24:07:d7:f
    To create a permanent ARP table entry for my airport basestation, I opened up a terminal window, and did the following -
    1) login to my administrator account
    2) type in the following command sudo arp -s 10.0.1.1 0:11:24:7:d7:f
    3) type in my administrator password to authorise the change
    4) type in (to confirm the changes have been made) arp -a
    5) logout of my administrator account (from the terminal)
    Ever since I did this, my MBP wireless performance has been flawless.
    Note, if you shutdown or restart your computer, the arp entry disappears. This is ok for me as I hardly ever power down my MBP. As insurance I have added an account startup item to remind me to do the arp table entry.
    This workaround is great for me because I don't have a need to use multiple wireless networks. It might not be practical for people who roam around onto different networks.
    Give it a go and see if it works for you.
    Message was edited by: michael louey

    OK, after some further experimenting, I changed the multicast rate on my airport express. It was set at 6Mbps, and I changed it to 2Mbps.
    I have read that the default multicast rate for previous 802.11g versions of Airport basestations is actually 2mbps. Excellent results so far !! I have set up a terminal command to continuously ping my airport router address every 15 sec, and there have been virtually no dropped packets so far over many hours.
    ping -i 15 10.0.1.1
    Interestingly, in Apple's Airport Admin software in my MBP there is no option to set the rate at less than 6Mbps (!!!!), so I had to use the Windows XP version of Airport admin software to make this change using a windows machine. Using the XP software you can set the muticast rate as low as 1Mbps.
    If you are using Apples airport admin software (Tiger and Leopard) and you commit any sort of change in settings, the multicast rate will be re-set at a minimum of 6Mbps. My understanding of the multicast rate is that setting it too high is similar to shrinking the coverage area of the basestation, and limiting access only to clients who can transmit at the required multicast rate.
    So my new theory is that the dropouts are caused by the MBP dropping off the airport due to not being able to achieve the set multicast rate. (this could be due to factors such as low signal strength, excessive interference or noise).
    If you are using Apples more recent Airport admin software, you are having a minimum 6mbps muticast rate set, and this might be too high for your particular environment.
    Just a theory.
    (oh yeah, I enabled interference robustness on the MBP and the basestation just for good measure)

  • Does SimpleDateFormat still have Thread Safety Issue in jdk 1.4.2_8?

    Hi,
    We are using jdk1.4.2_08 and experience following error message intermittently, sometimes once in 5000 or 10000 or 2/3 times in 20000 message processing.
    On one occassion, it reported as Empty String and other time it reported as ".20042005E200420054E". I won't suspect the input that's coming to this class since it works with same message over and over.
    2005-07-18 19:13:54,733 [RMI TCP Connection(6960)-10.120.102.97] INFO org.jboss.logging.util.LoggerStream write(140): java.lang.NumberFormatException: empty String
    2005-07-18 19:13:54,740 [RMI TCP Connection(6960)-10.120.102.97] INFO org.jboss.logging.util.LoggerStream write(140): at java.lang.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:983)
    2005-07-18 19:13:54,745 [RMI TCP Connection(6960)-10.120.102.97] INFO org.jboss.logging.util.LoggerStream write(140): at java.lang.Double.parseDouble(Double.java:220)
    2005-07-18 19:13:54,751 [RMI TCP Connection(6960)-10.120.102.97] INFO org.jboss.logging.util.LoggerStream write(140): at java.text.DigitList.getDouble(DigitList.java:127)
    2005-07-18 19:13:54,756 [RMI TCP Connection(6960)-10.120.102.97] INFO org.jboss.logging.util.LoggerStream write(140): at java.text.DecimalFormat.parse(DecimalFormat.java:1070)
    2005-07-18 19:13:54,761 [RMI TCP Connection(6960)-10.120.102.97] INFO org.jboss.logging.util.LoggerStream write(140): at java.text.SimpleDateFormat.subParse(SimpleDateFormat.java:1705)
    2005-07-18 19:13:54,767 [RMI TCP Connection(6960)-10.120.102.97] INFO org.jboss.logging.util.LoggerStream write(140): at java.text.SimpleDateFormat.parse(SimpleDateFormat.java:1156)
    2005-07-18 19:13:54,772 [RMI TCP Connection(6960)-10.120.102.97] INFO org.jboss.logging.util.LoggerStream write(140): at java.text.DateFormat.parse(DateFormat.java:333)
    It seems like some people have reported BugID 4228335 and there are few associated bugs. I assumed these are fixed in jdk1.4.
    Can anyone please suggest if this kind of issues still exist in jdk1.4.2?
    Here is the piece of code.
    private static SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    public Object convert(Class type, Object inValue) {
    if(inValue == null)
    return null;
    NFDate ret = (NFDate) ClassDirectoryFactory.GetInstance().getClassInstance(NFDate.CLASS_KEY);
    if (inValue instanceof Date) {
    ret.setDate((Date)inValue);
    } else if (inValue instanceof String) {
    String str = inValue.toString();
    if (str != null && str.length() > 0) {
    DateFormat format = DateFormat.getDateTimeInstance();
    format.setLenient(true);
    try {
    ret.setDate(format.parse(str));
    } catch (ParseException e) {
    try {
    ret.setDate(DATE_FORMAT.parse(str));
    } catch (ParseException e1) {
    throw new DateConversionException("Unable to convert the String to NFDate. " +
    "Exception: " + e + " - expected format is (" + format.format(new Date()) + ")", e1);
    else {
    if (!ret.getIsNullDate()) ret.reset();
    } else {
    String msg = "Conversion from " + inValue.getClass().getName() + " to " + NFDate.class.getName() +
    " is not supported";
    throw new DateConversionException(msg);
    return ret;
    Thanks much in advance.
    Saikat

    It doesn't look like the format classes will ever be made thread safe. The fact that they aren't isn't a bug, it is a design choice that Sun made. If you need them to be thread safe, then you will have to do the synchronization yourself.
    If you have a finite number of threads for you application (like a thread pool) then you might consider using ThreadLocal so that separate threads will not be trying to access the same formatter.

  • Is there a workaround for the thumbnail regeneration issue in CS5?

    Hullo.
    A friend uses my old version of CS5 and she is stuck with ACR 6.7, because this is the last version available in CS5.
    She seems to have huge problems in Bridge with the thumbnail regeneration bug described here, for instance: Cropping to an edge confuses Adobe Bridge?
    Concretely, although she has a relatively powerful machine, she is unable to work because there are always tens and tens of thumbnails being generated and her eight virtual cores completely fill the disk bandwidth, making Bridge impossible to use. I am not 100% sure that it is exactly this bug, but everything seems to correspond perfectly well: hundreds of DNG files with lens correction activated and very many cropped manually.
    Now, this is a confirmed bug of ACR 6.7 until ACR 8.2. She cannot switch to the latter without purchasing a newer version of Photoshop/Bridge.
    Does Adobe provide any fix for this bug in CS5? Could someone kindly point me to it? Her version of Bridge is simply unusable as is....
    If the answer above is no, I would be interested to know if this seems legal (not to say ethical...) to anybody: she is (otherwise) pretty happy with CS5 and she would need to buy a new licence for the sole and exclusive reason that the product Adobe sold me has a known and proven bug which makes it virtually useless in her setting.
    Thanks,
    p.

    There are two similar bugs:
    The LPC+crop bug started with ACR 6.1 and was fixed in 8.2.
    The LPC mystery bug started with ACR 7.3 and was fixed in 8.6.
    Both bugs cause repeated thumbnail extractions in Bridge on some images with Lens Profile Corrections enabled.
    As you are on ACR 6.7 it can only be the first bug. The only workaround I know is to ensure that the crop does not touch the edge of the corrected image. A few pixels gap will do it. Also, it helps to keep less images in a folder--but this can't be avoided when using Collections or Finds.
    I'd imagine that Adobe won't fix CS5 just for this. Presumably there's something in the smallprint which admonishes them from responsibility after the shelf life of the product ends. To be fair, it's not like they fixed it straight away in CS6, unlike the Bridge CS5 database bug (thanks, Adobe). They were only able to reproduce the fault in summer 2013.

  • Temporary workaround for 2007-004 Airport issue (Anecdotal)

    After re-installing the Wireless-N enabler on my 17in. MBP 2.33 (post Airport 2007-004), I have not experienced the connection drop for days now. Clearly this is not a fix or anything--just something others might want to try out. The dropping connection was the only issue I had.

    OK, after some further experimenting, I changed the multicast rate on my airport express. It was set at 6Mbps, and I changed it to 2Mbps.
    I have read that the default multicast rate for previous 802.11g versions of Airport basestations is actually 2mbps. Excellent results so far !! I have set up a terminal command to continuously ping my airport router address every 15 sec, and there have been virtually no dropped packets so far over many hours.
    ping -i 15 10.0.1.1
    Interestingly, in Apple's Airport Admin software in my MBP there is no option to set the rate at less than 6Mbps (!!!!), so I had to use the Windows XP version of Airport admin software to make this change using a windows machine. Using the XP software you can set the muticast rate as low as 1Mbps.
    If you are using Apples airport admin software (Tiger and Leopard) and you commit any sort of change in settings, the multicast rate will be re-set at a minimum of 6Mbps. My understanding of the multicast rate is that setting it too high is similar to shrinking the coverage area of the basestation, and limiting access only to clients who can transmit at the required multicast rate.
    So my new theory is that the dropouts are caused by the MBP dropping off the airport due to not being able to achieve the set multicast rate. (this could be due to factors such as low signal strength, excessive interference or noise).
    If you are using Apples more recent Airport admin software, you are having a minimum 6mbps muticast rate set, and this might be too high for your particular environment.
    Just a theory.
    (oh yeah, I enabled interference robustness on the MBP and the basestation just for good measure)

  • Is there a workaround for Facetime Apr 16th issue than upgrading to latest IOs ??

    Hi,
    I have IPad2 and I am facing the Facetime issue due to certificate expiry on Apr 16 as reported by Apple.
    I dont want to upgrade to latest IOS because I think it would slow down the performance and ruin a good working IPad just to resolve this issue.
    Is Apple going to provide some other alternative and/or fix the issue rather than forcing people to upgrade?

    Folks choices are to either update or move to a different app such as skype or some other video chat program.

  • Question on thread safety with Sevlet action method

    I have an application that runs well but seems to have trouble with multiple users and I suspect that there is some thread safety issue involved.
    It is a Struts application and I have all of my execute methods of the Acton classes are all synchronized which I thought would take care of any cross user issues but it does not seem to have done that.
    The Action classes do have some instance variables which may be the problem as well as possibly a few utility string classes with static methods that are not synchornized. I keep some db connection cached in the session object but this should not be shared between users.
    My question is, with the execute method synchronized how or where could I be getting crosstalk between users (each with their own sessions)?
    I was thinking of packaging my Action class as seperate object with the actual Action class just allocate what I need (messages and locale) and pass them through a freshly instantiated "old action class". That should solve any instance variable cross talk.
    I am assuming that any local variables in the execute method would not have any exposure as they should be thread specific and allocated on the runtime stack for that thread call.
    Am I missing anything important?
    Thanks in advance
    ---John Putnam

         * Creates a new instance of a {@link javax.xml.parsers.DocumentBuilder}
         * using the currently configured parameters.
        public DocumentBuilder newDocumentBuilder()
            throws ParserConfigurationException
            /** Check that if a Schema has been specified that neither of the schema properties have been set. */
            if (grammar != null && attributes != null) {
                if (attributes.containsKey(JAXPConstants.JAXP_SCHEMA_LANGUAGE)) {
                    throw new ParserConfigurationException(
                            SAXMessageFormatter.formatMessage(null,
                            "schema-already-specified", new Object[] {JAXPConstants.JAXP_SCHEMA_LANGUAGE}));
                else if (attributes.containsKey(JAXPConstants.JAXP_SCHEMA_SOURCE)) {
                    throw new ParserConfigurationException(
                            SAXMessageFormatter.formatMessage(null,
                            "schema-already-specified", new Object[] {JAXPConstants.JAXP_SCHEMA_SOURCE}));               
            try {
                return new DocumentBuilderImpl(this, attributes, features, fSecureProcess);
            } catch (SAXException se) {
                // Handles both SAXNotSupportedException, SAXNotRecognizedException
                throw new ParserConfigurationException(se.getMessage());
        }It appears to be thread-safe. The 'attributes' and 'features' instances variables are hashtables, which are synchronized. Unless you are modifying DocumentBuilderFactory itself in another thread (say, changing whether it is namespace aware), I do not see any issues with a simple call to newDocumentBuilder().
    - Saish

  • Vector Replacement in Java 1.4 - Is Thread Safety Needed In This Scenario?

    I have a Java 1.4 application that queries Database # 1, and builds custom strings used to create records that are inserted into Database # 2.
    Right now Vectors are used as a container to temporarily hold query output from Database # 1 while building records going into Database # 2, but I want to convert away from this legacy collection type.
    This application does this with a single "worker" thread that is started and monitored by the application main thread. If the main thread detects any exceptions, i.e. a network or any database problem, the application main thread will stop the single worker thread and restart a new single worker thread.
    There are several instances of this application running simultaneously on the same server but accessing different test databases. When put into the production environment this application will run on a separate server and there will be only 1 instance of the application running.
    I have reviewed numerous forums here and Google results and have not found much specific info that would closely apply to my exact design situation. I did not post any code since this is more of a design question than issue with a specific code snippet.
    My question is: In the scenario I described, does thread safety need to be a factor in choosing a new collection type (to replace Vectors) and in building code that accesses this new collection type?

    The several instances of the application are all independent JVMs and can't interact with each other directly at all. So there's no thread safety issue there and there never was. So what does that leave you? You've got a single worker thread using the Vector? There's no thread safety issue there either. The only time you have to think about thread safety is when two threads are trying to use the same object.

  • Thread safety in FMIS

    Can two threads access the same variable in an FMIS application?
    I'm collecting a queue (associative array) of values submitted by clients in an FMS App, and using setInterval to call a function which collects the queue at 10-second intervals, reads the values in the array, and sends them to a remote web service. I'm concerned that the first process might be trying to update the queue while the second is trying to use it.
    Everywhere I read that FMS apps are single threaded, but I've had some odd results at the web service which seem to indicate lost data. If there is a potential thread safety issue, could it be prevented by wrapping the queue in a sharedObject?

    The implementation is a bit more complex then this. When you create a JCD that implements an existing web service (ie a JCD that is started by a connector), eDesigner will create a message driven bean that is triggered by the connector and a stateless session bean that will be called from the message driven bean. This stateless session bean will call your JCD web service method, the receive or the start method.
    Because your JCD is hosted in a stateless session bean it will receive all the benefits of the J2EE thread and instance management. If there are multiple JMS messages to process, the application server can create multiple instances of the stateless session bean that hosts your JCd and thereby multiple instances of your JCD class will be created. If these are no longer needed, the application server can destroy them. As stateless session beans are thread safe, you do not need to code your JCD's in a thread safe manner. Of course if you want to access static resources or use singletons then you will need to access these in a threda safe manner from the JCD.
    When you JCD's are started by a JMS message (this is when your JCD's implement the JMS receive web service), you can configure in the connectivity map how many instances of your JCD can be started concurrently by the application server. When double clicking the configuration block on the JMS inbound connection you can specify two options:
    - Connection Consumer or Serial mode: multiple instances can be started when multiple messages are available or not.
    - Server session pool size: how many instances can be created.

  • What are the thread safety requirements for container implementation?

    I rarely see in the TopLink documentation reference to thread safety requirements and it’s not different for container implementation.
    The default TopLink implementation for:
    - List is Vector
    - Set is HashSet
    - Collection is Vector
    - Map is HashMap
    Half of them are thread safe implementations List/Collection and the other half is not thread safe Set/Map.
    So if I choose my own implementation do I need a thread safe implementation for?
    - List ?
    - Set ?
    - Collection ?
    - Map ?
    Our application is always reading and writing via UOW. So if TopLink synchronize update on client session objects we should be safe with not thread safe implementation for any type; does TopLink synchronize update on client session objects?
    The only thing we are certain is that it is not thread safe to read client session object or read read-only UOW object if they are ever expired or ever refreshed.
    We got stack dump below in an application always reading and writing objects from UOW, so we believe that TopLink doesn’t synchronize correctly when it’s updating the client session objects.
    java.util.ConcurrentModificationException
    at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:449)
    at java.util.AbstractList$Itr.next(AbstractList.java:420)
    at oracle.toplink.internal.queryframework.InterfaceContainerPolicy.next(InterfaceContainerPolicy.java:149)
    at oracle.toplink.internal.queryframework.ContainerPolicy.next(ContainerPolicy.java:460)
    at oracle.toplink.internal.helper.WriteLockManager.traverseRelatedLocks(WriteLockManager.java:140)
    at oracle.toplink.internal.helper.WriteLockManager.acquireLockAndRelatedLocks(WriteLockManager.java:116)
    at oracle.toplink.internal.helper.WriteLockManager.checkAndLockObject(WriteLockManager.java:349)
    at oracle.toplink.internal.helper.WriteLockManager.traverseRelatedLocks(WriteLockManager.java:144)
    at oracle.toplink.internal.helper.WriteLockManager.acquireLockAndRelatedLocks(WriteLockManager.java:116)
    at oracle.toplink.internal.helper.WriteLockManager.checkAndLockObject(WriteLockManager.java:349)
    at oracle.toplink.internal.helper.WriteLockManager.traverseRelatedLocks(WriteLockManager.java:144)
    at oracle.toplink.internal.helper.WriteLockManager.acquireLockAndRelatedLocks(WriteLockManager.java:116)
    at oracle.toplink.internal.helper.WriteLockManager.acquireLocksForClone(WriteLockManager.java:56)
    at oracle.toplink.publicinterface.UnitOfWork.cloneAndRegisterObject(UnitOfWork.java:756)
    at oracle.toplink.publicinterface.UnitOfWork.cloneAndRegisterObject(UnitOfWork.java:714)
    at oracle.toplink.internal.sessions.UnitOfWorkIdentityMapAccessor.getAndCloneCacheKeyFromParent(UnitOfWorkIdentityMapAccessor.java:153)
    at oracle.toplink.internal.sessions.UnitOfWorkIdentityMapAccessor.getFromIdentityMap(UnitOfWorkIdentityMapAccessor.java:99)
    at oracle.toplink.internal.sessions.IdentityMapAccessor.getFromIdentityMap(IdentityMapAccessor.java:265)
    at oracle.toplink.publicinterface.UnitOfWork.registerExistingObject(UnitOfWork.java:3543)
    at oracle.toplink.publicinterface.UnitOfWork.registerExistingObject(UnitOfWork.java:3503)
    at oracle.toplink.queryframework.ObjectLevelReadQuery.registerIndividualResult(ObjectLevelReadQuery.java:1812)
    at oracle.toplink.internal.descriptors.ObjectBuilder.buildWorkingCopyCloneNormally(ObjectBuilder.java:455)
    at oracle.toplink.internal.descriptors.ObjectBuilder.buildObjectInUnitOfWork(ObjectBuilder.java:419)
    at oracle.toplink.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:379)
    at oracle.toplink.queryframework.ObjectLevelReadQuery.buildObject(ObjectLevelReadQuery.java:455)
    at oracle.toplink.queryframework.ObjectLevelReadQuery.conformIndividualResult(ObjectLevelReadQuery.java:622)
    at oracle.toplink.queryframework.ReadObjectQuery.conformResult(ReadObjectQuery.java:339)
    at oracle.toplink.queryframework.ReadObjectQuery.registerResultInUnitOfWork(ReadObjectQuery.java:604)
    at oracle.toplink.queryframework.ReadObjectQuery.executeObjectLevelReadQuery(ReadObjectQuery.java:421)
    at oracle.toplink.queryframework.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:811)
    at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:620)
    at oracle.toplink.queryframework.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:779)
    at oracle.toplink.queryframework.ReadObjectQuery.execute(ReadObjectQuery.java:388)
    at oracle.toplink.queryframework.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:836)
    at oracle.toplink.publicinterface.UnitOfWork.internalExecuteQuery(UnitOfWork.java:2604)
    at oracle.toplink.publicinterface.Session.executeQuery(Session.java:993)
    at oracle.toplink.publicinterface.Session.executeQuery(Session.java:950)

    Hi Lionel,
    As a general rule of thumb, the ATI Rage 128 Pro will not support a 20" LCD. That being said, there are reports of it doing just that (possibly the edition that went into the cube).
    I'm not that familiar with the ins and outs of the Cube, so I can't give you authoritative information on it.
    A good place to start looking for answers is:
    http://cubeowner.com/kbase_2/
    Cheers!
    Karl

  • JTree display issues and thread safety

    I've recently ran into some issues with a JTree not displaying correctly. Infrequently, blank space will appear in the tree (big gaps between consecutive nodes), or the text of a node will be cut off ending with a "...". This happens when (but not yet proven a direct result of) one thread is expanding a node of the tree while another thread is inserting nodes into one of the expanding node's children through calls to DefaultTreeModel.insertNodeInto. (what I'm doing here is lazy loading the children's children when the parent is expanded, and the lazy loading is performed by a seperate thread so as not to delay the main thread.) It does not happen if the second thread simply adds child nodes without using the DefaultTreeModel's insertNodeInto method.
    I think what might be happening here is that the DefaultTreeModel.insertNodeInto method is calling fireTreeNodesInserted which I think is in turn causing nodes in the tree to be re-rendered. This got me thinking that the problem may come down to the DefaultTreeCellRenderer being used by the two threads simultaneously. DefaultTreeCellRenderer extends JLabel and returns itself in the getTreeCellRendererComponent method. If two threads were causing nodes to be rendered at the same time, it would seem the rendered label could be occasionally in an inconsistent state.
    Anyone ran into a situation like this before? The problem of text being cut off seems to be eliminated by having a custom renderer return a new component each time, rather than returning itself, but this results in degraded performance. It's almost as if each thread would need it's own renderer (or the renderer would need to return a different component for each thread), but I'm not sure how this would be done. And this doesn't solve the problem of gaps appearing in the tree.
    As for the gaps, I think this might be solved by changing when the children's children are getting loaded in respect to the parent node expanding. At first I was using a TreeWillExpandListener that fired off loading the children's children. I think I might can solve the white space in the tree problem by changing that to a TreeExpansionListener that uses the treeExpanded method. So far this seems to be working...so that the parent node is done expanding before the second thread begins loading the children's children.
    Any thoughts?

    I actually found the thread3 article first... since there doesn't seem to be direct links between them, I thought I would add for anyone who reads this thread that there are several related articles. sabre150 linked the first; the others are the same base URL but with the number incremented for each. For example, the 2nd article is:
    [http://java.sun.com/products/jfc/tsc/articles/threads/threads2.html]
    And the 3rd article, which most directly applies to what I am doing, is:
    [http://java.sun.com/products/jfc/tsc/articles/threads/threads3.html]
    Edited by: Skotty on Mar 5, 2009 9:35 PM -- links turned into actual links
    Edited by: Skotty on Mar 5, 2009 9:36 PM -- formatted for nicer display

Maybe you are looking for

  • Share iCloud drive with family members

    Has anybody figured out how to share iCloud drive with family members? I was using Amazon Cloud drive which used to have an app you could download and imbed into Finder, but with OS X 10.1 this is no longer supported so I've switched over to iCloud d

  • OCI ORA-01017: invalid username/password;logon denied

    I am attempting to connect to the database through OCI, and am receiving this error: OCI ORA-01017: invalid username/password;logon denied I know the username and password I am using is correct. Is there some setting in the init.ora file that needs t

  • Why is FireFox allowing "Canvas Fingerprinting" to track me?

    Since "Canvas Fingerprinting" seems to be the new way of tracking one. How does one TURN IT OFF! A New Form of Online Tracking: Canvas Fingerprinting http://yro.slashdot.org/story/14/07/22/0140256/a-new-form-of-online-tracking-canvas-fingerprinting P

  • How to create a SlideShow in GoLiveCS2 using Actions

    Good day to all, I was wondering if anyone has an idea how to make a photo slideshow in GoLive CS2 using the Actions? I have no experience in JavaScript, Actionscript and am not a programmer. Any information would be highly appreciated. I know how to

  • Mass update for production and planned order MRP controller

    Hi Gurus, It's anyway possible to mass update MRP controller for Production orders and  Planned orders. If any please provide me step by step process. Thanks, B.Deethya.