Time to create object dependent on depth of class hierachy?

hi,
running the code below seems to show that instantiating two classes that have the same members but have different inheritence trees can effect the object creation time.
(A2 is taking longer on my tests on Windows, HP/UX and Linux, and the same amount of time under Solaris)
is the test broken? if not, then can anyone explain why this is the case?
thanks,
asjf
class G {int g;}
class F extends G {int f;}
class E extends F {int e;}
class D extends E {int d;}
class C extends D {int c;}
class B extends C {int b;}
class A1 extends B {int a;}
class A2 {
   int a,b,c,d,e,f,g;
public class GoTest {
   public static void main(String [] arg) {
      long COUNT = 5000000, timer=0;
      while(true) {
         timer = -System.currentTimeMillis();
         for(int i=0; i<COUNT; i++) new A1();
         System.out.print("inheriting="+(timer+System.currentTimeMillis()));
         timer = -System.currentTimeMillis();
         for(int i=0; i<COUNT; i++) new A2();
         System.out.println(", flat="+(timer+System.currentTimeMillis()));
}

The test is broken. I've run the program on Windows,
and without changes it behaves as you describe. But
swap the test loops and suddenly the flat objects are
allocated faster. After some experiments, my guess
would be that the first test loop, maybe even the
first allocation determines which runs faster. Looks
like some optimization of the VM kicks in, depending
on what happens first. I don't have the server VM
installed, but the results might clarify things a bit.ah good point about swapping the tests - i get the same results..
running 1.4.2 java with -server makes both loops take the same time. I don't get why there is such a long delay on the second object creation loop though..
so that only leaves the question why this slightly altered bit of code has a limp on the client vm (like Morin suggested it depends on which class goes first)
thanks,
asjf
import java.util.Random;
class A {}
class B {}
public class GoTest2 {
   public static void main(String [] arg) {
      long COUNT = 5000000, timer=0;
      Random r = new Random();
      while(true) {  
           if(r.nextBoolean()) {
              timer = -System.currentTimeMillis();
              for(int i=0; i<COUNT; i++) new A();
              System.out.println("a "+(timer+System.currentTimeMillis()));
           } else {
              timer = -System.currentTimeMillis();
              for(int i=0; i<COUNT; i++) new B();
              System.out.println("b "+(timer+System.currentTimeMillis()));
}

Similar Messages

  • Object dependency doesn't work for class type 001.

    Dear All,
    I would like to use classification for picking up material.
    I set up a class with class type 001 and assign to material.
    When I use mm03 to search the material with class, the object dependency in the characterist doesn't work.
    Does the object dependency work for the class type 001?
    The example is as below.
    If the characteristic CH_CAR = '01', then the characteristic CH_COLOR can show Red and Write.
    If the characteristic CH_CAR = '02', then the characteristic CH_COLOR can show Black and Blue.
    I wrote a depency precondition for this scenior, but it does't work.
    If I change the class to type 300 and attached to a configurable material, then when I create a sales order and configure the material, and the dependency did work.
    Does the object depency only support the class type 300?

    you can have object dependency in characterisitcs attached to material class. In this thread underneath the class is 001
    Length & Width is not converted in classivication view
    you may not be able to find objects using dependencies used in classification
    Object Dependencies in Classification - Classification System (CA-CL) - SAP Library

  • GP Design Time - what is the purpose of 'Create Object View' option?

    We are running EP 7.01.  When I am in the GP Design Time, and I click on the 'Create Object View' link, I receive the following error:
    The initial exception that caused the request to fail, was:
       java.lang.NullPointerException
        at com.sap.caf.eu.gp.ui.bo.VCreateBasicData.wdDoInit(VCreateBasicData.java:103)
        at com.sap.caf.eu.gp.ui.bo.wdp.InternalVCreateBasicData.wdDoInit(InternalVCreateBasicData.java:159)
        at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doInit(DelegatingView.java:61)
        at com.sap.tc.webdynpro.progmodel.controller.Controller.initController(Controller.java:215)
        at com.sap.tc.webdynpro.progmodel.view.View.initController(View.java:445)
        ... 55 more
    What is the purpose of the 'Create Object View' option?  I cannot find it in the documentation.

    Hi Karen,
    The Object Types are used to define the Parameters for the Callable Objects. We Can create the Object Views for the CAF Core Entity services or UME Pricipal Objects such as Users,Roles Groups etc. While creating the Object View we can select either of these and then we can create a view i..e. Select the required attributes from those Business Objects i.e. Entity Services or the Principals. Once we create the Object View, we can use them to define the Parameters for the callable Objects. While defining the parameters for Callable Objects, if you click the dropdown for 'Type', you'll see an entry 'Reference to BO'. If you select the entry, you'll see the list of Object Views you have created and you can select the Object View you want for defining that parameter. In short it means that you can create the Obect Views for the BOs i.e. CAF core Entity services and Pricipals. And then you can define the parameters for the Callable Objects with type 'Refence to BO' pointing to your object views.
    [further Info|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/44/051d496d9c5922e10000000a155369/frameset.htm]
    [Some more Info|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/44/051d496d9c5922e10000000a155369/frameset.htm]
    Regards,
    Ajay

  • XL Reporter Run-time Error '429' ActiveX component can't create object

    Hi Everyone,
    When trying to install XL Reporter on a Windows 2003 Server SP2 machine getting the following Error:
    XL Reporter
    Run-time error '429':
    ActiveX component can't create object.
    Did anyone get this error? Please advise of any steps we can try to resolve.
    Kind Regards,
    Kafil

    Dear Friend,
                 I had described the problem to our technical support team, and they replied as follows u2013
    They solved the Script related error by several stages.
    They checked the machine for any mal-ware existence by the tool provided by Microsoft (MS Mal-ware remover).
    Then they tried by installing the following patches from Microsoft u2013
    http://support.microsoft.com/kb/949140
    Windows Script 5.7 for Windows XP
    http://www.microsoft.com/downloads/details.aspx?familyid=887fce82-e3f5-4289-a5e3-6cbb818623aa&displaylang=en
    Windows Script 5.6 for Windows Server 2003
    http://www.microsoft.com/downloads/details.aspx?FamilyId=C717D943-7E4B-4622-86EB-95A22B832CAA&displaylang=en
    Windows Script 5.6 for Windows XP and Windows 2000
    The internal matter to this problem was about the following DLL and its version u2013
    C:\WINDOWS\system32
    vbscript.dll
    5.5.0.8820
    Desired
    5.6.0.8820
    Check, if the information helps you.

  • Run-time error '429': ActiveX component can't create object

    HI,
    I am having the following error in my Excel VBA Run-time error '429': ActiveX component can't create object  when running the following code:
    Dim objDistiller As New ACRODISTXLib.PdfDistiller6
    objDistiller.FileToPDF2 filePath & ".PS", filePath & ".PDF", "T:\Templates\PDFSettings\Standard.joboptions", 1
    This code has been working for years on all our systems, but due to recent security issues our administrator changed all user accounts to not have local administrator rights and now when we run this code we get the above error message.
    I have had a look at DComcnfg.exe to try and get it to work by setting the default property permissions to allow access by Everyone but I am still getting the error.
    Any help would be greatly appreciated.
    Regards.
    Shane Chapman.

    Hi Shane,
    Here is another way to create PDF with Macro using another API than Distiller. This API is faster too.
    Probably this post is not of interest anymore but here is how I have done it:
    1. Download PDFCreator: http://sourceforge.net/projects/pdfcreator/
    2. Use the following Macro:
    Option Explicit
    Sub printPDFmacro()
    'Author : Ken Puls (www.excelguru.ca)
    'Macro Purpose: Print to PDF file using PDFCreator
    ' (Download from http://sourceforge.net/projects/pdfcreator/)
    ' Designed for early bind, set reference to PDFCreator
    Dim pdfjob As PDFCreator.clsPDFCreator
    Dim sPDFName As String
    Dim sPDFPath As String
    '/// Change the output file name here! ///
    sPDFName = "Facture-" & nclient2 & " le " & Format(Date, "yyyy-mm-dd") & ".pdf"
    sPDFPath = "E:\Partenaire Scolaire\Comptabilite\Factures"
    PDFFileName2 = sPDFPath & "\" & sPDFName
    Set pdfjob = New PDFCreator.clsPDFCreator
    With pdfjob
    If .cStart("/NoProcessingAtStartup") = False Then
    MsgBox "Can't initialize PDFCreator.", vbCritical + _
    vbOKOnly, "PrtPDFCreator"
    Exit Sub
    End If
    .cOption("UseAutosave") = 1
    .cOption("UseAutosaveDirectory") = 1
    .cOption("AutosaveDirectory") = sPDFPath
    .cOption("AutosaveFilename") = sPDFName
    .cOption("AutosaveFormat") = 0 ' 0 = PDF
    .cClearCache
    End With
    'Print the document to PDF
    ActiveSheet.PrintOut copies:=1, ActivePrinter:="PDFCreator"
    'Wait until the print job has entered the print queue
    Do Until pdfjob.cCountOfPrintjobs = 1
    DoEvents
    Loop
    pdfjob.cPrinterStop = False
    'Wait until PDF creator is finished then release the objects
    Do Until pdfjob.cCountOfPrintjobs = 0
    DoEvents
    Loop
    pdfjob.cClose
    Set pdfjob = Nothing
    end sub
    Have any questions, just have to poke me.
    Michael

  • Run time error '429' Active X component can't create object

    Hi,
    After installation of BI+, when i am trying to start the Financial reporting studio, I am the error'429' " run time error Active X component can't create object.
    I thought of stoping and stating the BI+ Core Services it is not allowing me to do that,
    Could you please help me in the installation BI+
    thanks,
    sudhakar

    Hi Johan,
    BI core services up and running, but still it is giving " cannot connect to GSM server server name"
    all the configaration went with green, Could please let me know other oprions or where I can find the error.
    Please let us know possible mistakes, I will try that options,
    thanks a lot John
    thanks,
    sudhakar

  • Run time error '429' Active X Componenet can't create object

    Hi,
    We are getting this error "Run time error '429' Active X Componenet can't create object" when we open the Input templates.
    No drop down of the Dimension members is  appearing.
    Please help.
    Reagrds,
    Anita

    Hi Anita,
    Please try imeplenting SAP Note: 1508168. Hope this helps.
    Rgds,
    Poonam

  • Creation of Object Dependency (OD)

    Hi Gurus,
    Currently we have customized a program to create/update object dependencies. However we have a problem that sometimes the object dependency is deleted and not updated back. As we cannot simulate this all the time (especially during debugging) and we don't know why is it having this issue, we are looking at options to enhance the following codes.
    We are using 2 function modules CAMA_CLASS_CHAR_DEL_DEP (to delete) and CAMA_CLASS_CHAR_MAINTAIN_DEP (to create)
            CALL FUNCTION 'CAMA_CLASS_CHAR_DEL_DEP'
              EXPORTING
                CLASS                  = <FS_DEP_CHR_A>-CLASS
                CLASS_TYPE             = '300'
                CHARACTERISTIC         = <FS_DEP_CHR_A>-CHARACT
                DELETE_LOCAL_DEP       = 'X'
              IMPORTING
                RETURN                 = WA_RETURN2
              TABLES
                DEP_ASSIGN_DEL         = IT_DEP_ASSIGN_DEL.
            READ TABLE IT_RETURN INTO WA_RETURN WITH
                      KEY TYPE = 'E'.
            IF SY-SUBRC NE 0.
              CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
                EXPORTING
                  WAIT = 'X'.
            CALL FUNCTION 'CAMA_CLASS_CHAR_MAINTAIN_DEP'
              EXPORTING
                CLASS                 = <FS_DEP_CHR_A>-CLASS
                CLASS_TYPE            = '300'
                CHARACT               = <FS_DEP_CHR_A>-CHARACT
                DEPENDENCY_DATA       = WA_SEL_DEPDAT
                KEY_DATE              = SY-DATUM
              TABLES
                DESCRIPTION           = IT_SEL_DEPDESCR
                SOURCE                = IT_SEL_SOURCE
                DOCUMENTATION         = IT_SEL_DOC
              EXCEPTIONS
                ERROR                 = 1
                WARNING               = 2
                OTHERS                = 3.
            IF SY-SUBRC EQ 0.
              CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
                EXPORTING
                  WAIT = 'X'.
    Points will be rewarded for useful answers. Many thanks in advance.
    Rgds

    Mainly due locking issues. Added some logic to wait.

  • How to create object per thread

    Hi everyone,
    This is my problem. I want to have a static method. Inside of it I want to add an element into a List, let's say I want to track something by doing this. But I also want this List to have multiple copies depending on threads, which means for every call to this static method, I want to call the "add" method on different List objects depending which thread it is from.
    Does it make sense? Do I need to have a thread pool to keep those thread references or something?
    How about I use Thread.currentThread() to determine whether this call is from a different thread so that I create another List?
    Thank you very much!
    Edited by: feiya200 on Feb 26, 2008 10:31 PM

    want to be perfect with singleton as why it is needed and how it works so see this by [email protected], Bijnor
    For those who haven't heard of design patterns before, or who are familiar with the term but not its meaning, a design pattern is a template for software development. The purpose of the template is to define a particular behavior or technique that can be used as a building block for the construction of software - to solve universal problems that commonly face developers. Think of design code as a way of passing on some nifty piece of advice, just like your mother used to give. "Never wear your socks for more than one day" might be an old family adage, passed down from generation to generation. It's common sense solutions that are passed on to others. Consider a design pattern as a useful piece of advice for designing software.
    Design patterns out of the way, let's look at the singleton. By now, you're probably wondering what a singleton is - isn't jargon terrible? A singleton is an object that cannot be instantiated. At first, that might seem counterintuitive - after all, we need an instance of an object before we can use it. Well yes a singleton can be created, but it can't be instantiated by developers - meaning that the singleton class has control over how it is created. The restriction on the singleton is that there can be only one instance of a singleton created by the Java Virtual Machine (JVM) - by prevent direct instantiation we can ensure that developers don't create a second copy.
    So why would this be useful? Often in designing a system, we want to control how an object is used, and prevent others (ourselves included) from making copies of it or creating new instances. For example, a central configuration object that stores setup information should have one and one only instance - a global copy accessible from any part of the application, including any threads that are running. Creating a new configuration object and using it would be fairly useless, as other parts of the application might be looking at the old configuration object, and changes to application settings wouldn't always be acted upon. I'm sure you can think of a other situations where a singleton would be useful - perhaps you've even used one before without giving it a name. It's a common enough design criteria (not used everyday, but you'll come across it from time to time). The singleton pattern can be applied in any language, but since we're all Java programmers here (if you're not, shame!) let's look at how to implement the pattern using Java.
    Preventing direct instantiation
    We all know how objects are instantiated right? Maybe not everyone? Let's go through a quick refresher.
    Objects are instantiated by using the new keyword. The new keyword allows you to create a new instance of an object, and to specify parameters to the class's constructor. You can specify no parameters, in which case the blank constructor (also known as the default constructor) is invoked. Constructors can have access modifiers, like public and private, which allow you to control which classes have access to a constructor. So to prevent direct instantiation, we create a private default constructor, so that other classes can't create a new instance.
    We'll start with the class definition, for a SingletonObject class. Next, we provide a default constructor that is marked as private. No actual code needs to be written, but you're free to add some initialization code if you'd like.
    public class SingletonObject
         private SingletonObject()
              // no code req'd
    So far so good. But unless we add some further code, there'll be absolutely no way to use the class. We want to prevent direct instantiation, but we still need to allow a way to get a reference to an instance of the singleton object.
    Getting an instance of the singleton
    We need to provide an accessor method, that returns an instance of the SingletonObject class but doesn't allow more than one copy to be accessed. We can manually instantiate an object, but we need to keep a reference to the singleton so that subsequent calls to the accessor method can return the singleton (rather than creating a new one). To do this, provide a public static method called getSingletonObject(), and store a copy of the singleton in a private member variable.
    public class SingletonObject
    private SingletonObject()
    // no code req'd
    public static SingletonObject getSingletonObject()
    if (ref == null)
    // it's ok, we can call this constructor
    ref = new SingletonObject();
    return ref;
    private static SingletonObject ref;
    So far, so good. When first called, the getSingletonObject() method creates a singleton instance, assigns it to a member variable, and returns the singleton. Subsequent calls will return the same singleton, and all is well with the world. You could extend the functionality of the singleton object by adding new methods, to perform the types of tasks your singleton needs. So the singleton is done, right? Well almost.....
    Preventing thread problems with your singleton
    We need to make sure that threads calling the getSingletonObject() method don't cause problems, so it's advisable to mark the method as synchronized. This prevents two threads from calling the getSingletonObject() method at the same time. If one thread entered the method just after the other, you could end up calling the SingletonObject constructor twice and returning different values. To change the method, just add the synchronized keyword as follows to the method declaration :-
    public static synchronized
         SingletonObject getSingletonObject()
    Are we finished yet?
    There, finished. A singleton object that guarantees one instance of the class, and never more than one. Right? Well.... not quite. Where there's a will, there's a way - it is still possible to evade all our defensive programming and create more than one instance of the singleton class defined above. Here's where most articles on singletons fall down, because they forget about cloning. Examine the following code snippet, which clones a singleton object.
    public class Clone
         public static void main(String args[])
         throws Exception
         // Get a singleton
         SingletonObject obj =
         SingletonObject.getSingletonObject();
         // Buahahaha. Let's clone the object
         SingletonObject clone =
              (SingletonObject) obj.clone();
    Okay, we're cheating a little here. There isn't a clone() method defined in SingletonObject, but there is in the java.lang.Object class which it is inherited from. By default, the clone() method is marked as protected, but if your SingletonObject extends another class that does support cloning, it is possible to violate the design principles of the singleton. So, to be absolutely positively 100% certain that a singleton really is a singleton, we must add a clone() method of our own, and throw a CloneNotSupportedException if anyone dares try!
    Here's the final source code for a SingletonObject, which you can use as a template for your own singletons.
    public class SingletonObject
    private SingletonObject()
    // no code req'd
    public static SingletonObject getSingletonObject()
    if (ref == null)
    // it's ok, we can call this constructor
    ref = new SingletonObject();          
    return ref;
    public Object clone()
         throws CloneNotSupportedException
    throw new CloneNotSupportedException();
    // that'll teach 'em
    private static SingletonObject ref;
    Summary
    A singleton is an class that can be instantiated once, and only once. This is a fairly unique property, but useful in a wide range of object designs. Creating an implementation of the singleton pattern is fairly straightforward - simple block off access to all constructors, provide a static method for getting an instance of the singleton, and prevent cloning.
    What is a singleton class?
    A: A class whose number of instances that can be instantiated is limited to one is called a singleton class. Thus, at any given time only one instance can exist, no more.
    Q: Can you give me an example, where it is used?
    A: The singleton design pattern is used whenever the design requires only one instance of a class. Some examples:
    �     Application classes. There should only be one application class. (Note: Please bear in mind, MFC class 'CWinApp' is not implemented as a singleton class)
    �     Logger classes. For logging purposes of an application there is usually one logger instance required.
    Q: How could a singleton class be implemented?
    A: There are several ways of creating a singleton class. The most simple approach is shown below:
    Code:
    class CMySingleton
    public:
    static CMySingleton& Instance()
    static CMySingleton singleton;
    return singleton;
    // Other non-static member functions
    private:
    CMySingleton() {}; // Private constructor
    CMySingleton(const CMySingleton&); // Prevent copy-construction
    CMySingleton& operator=(const CMySingleton&); // Prevent assignment
    Can I extend the singleton pattern to allow more than one instance?
    A: The general purpose of the singleton design pattern is to limit the number of instances of a class to only one. However, the pattern can be extended by many ways to actually control the number of instances allowed. One way is shown below...
    class CMyClass
    private:
    CMyClass() {} // Private Constructor
    static int nCount; // Current number of instances
    static int nMaxInstance; // Maximum number of instances
    public:
    ~CMyClass(); // Public Destructor
    static CMyClass* CreateInstance(); // Construct Indirectly
    //Add whatever members you want
    };

  • XML Parsing and creating objects..

    I need to create objects with the value present in the XML file under a specific tag.
    E.g.:
    XML file:
    <employees.
    <employee>
    <name>
    <first>Chandan</first>
    <last>Sharma</last>
    </name>
    <empid>1212</empid>
    <dept>Telecom</dept>
    </employee>
    <employee>
    <name>
    <fitst>First</first>
    <last>Last</last>
    </name>
    <empid>100</empid>
    <dept>Dept</dept>
    </employee>
    </employees>
    There may be tags other than <employees> in the XML file.
    I need to parse this file and create objects of class
    Employees{
    String firstName,lastName,empid,dept;
    Please help me.
    As I am new with this, it would be better if you provide me some with code.
    Thanks & Regards,
    Chandan Sharma

    You can od it using SAX of course but the implementation is completely different. As I haven't used any SAX approach for many years, I can't provide you any example but you should find many of them either with google or by downloading any java implementation (like Xerces, Xalan...)
    The better solution depends on your needs. That's the standard answer, I know :)
    when you use DOM, you load the entire content of the file in the memory. and then you travel through the JAVA structure that has been created by using the methods I gave you.
    When you use SAX, you define a listener for your parser that will be called any time the parser finds something interesting. a new node, a new attribute, a new node content... sometimes it's a pain to implement.
    In my opinion if your application will only handle one message at a time, you should keep the DOM approach because I don't think there will be any big difference in time processing. On the other hand if your application will potentially manage multiple messages at the same time, then your computer memory can be overloaded by a DOM approach and the you will face bad performances, in such case use the SAX approach.
    as a conclusion, the best way to make a decision is to run benchmarks. good luck :)
    Marc

  • Finalize() method being called multiple times for same object?

    I got a dilly of a pickle here.
    Looks like according to the Tomcat output log file that the finalize method of class User is being called MANY more times than is being constructed.
    Here is the User class:
    package com.db.multi;
    import java.io.*;
    import com.db.ui.*;
    import java.util.*;
    * @author DBriscoe
    public class User implements Serializable {
        private String userName = null;
        private int score = 0;
        private SocketImage img = null;
        private boolean gflag = false;
        private Calendar timeStamp = Calendar.getInstance();
        private static int counter = 0;
        /** Creates a new instance of User */
        public User() { counter++;     
        public User(String userName) {
            this.userName = userName;
            counter++;
        public void setGflag(boolean gflag) {
            this.gflag = gflag;
        public boolean getGflag() {
            return gflag;
        public void setScore(int score) {
            this.score = score;
        public int getScore() {
            return score;
        public void setUserName(String userName) {
            this.userName = userName;
        public String getUserName() {
            return userName;
        public void setImage(SocketImage img) {
            this.img = img;
        public SocketImage getImage() {
            return img;
        public void setTimeStamp(Calendar c) {
            this.timeStamp = c;
        public Calendar getTimeStamp() {
            return this.timeStamp;
        public boolean equals(Object obj) {
            try {
                if (obj instanceof User) {
                    User comp = (User)obj;
                    return comp.getUserName().equals(userName);
                } else {
                    return false;
            } catch (NullPointerException npe) {
                return false;
        public void finalize() {
            if (userName != null && !userName.startsWith("OUTOFDATE"))
                System.out.println("User " + userName + " destroyed. " + counter);
        }As you can see...
    Every time a User object is created, a static counter variable is incremented and then when an object is destroyed it appends the current value of that static member to the Tomcat log file (via System.out.println being executed on server side).
    Below is the log file from an example run in my webapp.
    Dustin
    User Queue Empty, Adding User: com.db.multi.User@1a5af9f
    User Dustin destroyed. 0
    User Dustin destroyed. 0
    User Dustin destroyed. 0
    User Dustin destroyed. 0
    User Dustin destroyed. 0
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 1
    User Dustin destroyed. 1
    User Dustin destroyed. 1
    User Dustin destroyed. 1
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    Joe
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin pulled from Queue, Game created: Joe
    User Already Placed: Dustin with Joe
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    INSIDE METHOD: false
    INSIDE METHOD: false
    USER QUEUE: true
    INSIDE METHOD: false
    INSIDE METHOD: false
    User Dustin destroyed. 9
    User Joe destroyed. 9
    User Dustin destroyed. 9
    User Dustin destroyed. 9
    User Dustin destroyed. 9
    User Dustin destroyed. 9
    INSIDE METHOD: true
    INSIDE METHOD: false
    USER QUEUE: true
    INSIDE METHOD: false
    INSIDE METHOD: false
    INSIDE METHOD: true
    INSIDE METHOD: false
    USER QUEUE: true
    INSIDE METHOD: false
    INSIDE METHOD: false
    It really does seem to me like finalize is being called multiple times for the same object.
    That number should incremement for every instantiated User, and finalize can only be called once for each User object.
    I thought this was impossible?
    Any help is appreciated!

    Thanks...
    I am already thinking of ideas to limit the number of threads.
    Unfortunately there are two threads of execution in the servlet handler, one handles requests and the other parses the collection of User objects to check for out of date timestamps, and then eliminates them if they are out of date.
    The collection parsing thread is currently a javax.swing.Timer thread (Bad design I know...) so I believe that I can routinely check for timestamps in another way and fix that problem.
    Just found out too that Tomcat was throwing me a ConcurrentModificationException as well, which may help explain the slew of mysterious behavior from my servlet!
    The Timer thread has to go. I got to think of a better way to routinely weed out User objects from the collection.
    Or perhaps, maybe I can attempt to make it thread safe???
    Eg. make my User collection volatile?
    Any opinions on the best approach are well appreciated.

  • Error in price at the time of creating SHC fro catalogue item

    Hi
    Cann anyone help me with the following problem.
    Error in price at the time of creating SHC fro catalogue item
    mentioned below article no. 0452202 then a pallet is to cost 3275,05 (you can only order min. 10 pallets).
    The system multiplies up the price by 10 & 10 and at that moment I transfer the shopping trolley it multiplies up again.
    The price for 10 pallets was gladly to be 32720,50 - Buttttttttttttt it turns into 3.272.050.
    Please help me in providing a solution for this
    Best Regards.
    sairam.

    Hi
    Please go through this ->
    Note 739562 Simplified pricing: Price 0.00 if catalog item.
    This is the standard system response as of EBP 3.5 Support Package 05 or Note 569275.
    This also depends on how you uploaded the price in the catalogs ->
    For price details you should use the following characteristics:-
    /ccm/price[1]#/ccm/amount /ccm/price[1]#/ccm/currency_code
    Perhaps you have to maintain field pricechangeable in BADi-InterfaceIF_EX_BBP_CATALOG_TRANSFER in method - ENRICH_ITEM_DATA. This will make sure you can edit the price_
    Other useful pointers ->
    Re: Price determination
    Re: free item shopping from catalogue....product with zero price
    OSS note 550071 - price for catalog product
    How to Upload Price details for a catalog in CCM 2.0
    Do let me know.
    Regards
    - Atul

  • Automatic Creation of primary key at the time of creating entries

    Hi All,
    I have a requirement to generate the primary key automatically at the time of creating entries. I have managed to do so by writing an event code for the maintainance object in SE54.
    However called only when I create entries throught the Maintainance View.
    It does not get called when I write an insert statement in the program.
    Please suggest a way to achieve this.
    Thanks in advance,
    Archana.

    for assigning the primary key while using insert statement, write a piece of code to get the last pk value, increment it by 1 and then assign this value to the pk field of the next record while inserting. if you are using a fn mod to insert values, just have this piece of code right before the insert query. a better way would be to use a GUID which will be unique globally. there is a fn mod GUID_CREATE which you can use to generate GUID. i don't think there is a way to automate this while making entries using se11, unless you change the code that actually creates the entry in the database.

  • PDS Creation with Object Dependency

    Hello Gurus,
    I´ve written a function to run BAPI_PDSSRVAPS_SAVEMULTI in order to create PDS with object dependency (Super BOM). The PDS created by my function looks good in CURTO_SIMU, but it is not respecting the characteristic dependency during PPDS Heuristic. If I take a PDS generated in ECC with the exact same attributes, the heuristics explodes the components correctly. When I run the getlist bapi, it shows both ECC created and function created with all tables (pds_header, pds_component,) filled with the same content. Though, one PDS works and the other doesnt. I am clueless.
    thank you a lot.
    Cheers
    Rafael

    Mainly due locking issues. Added some logic to wait.

  • Importance of object dependency  type procedure

    Hi Friend,
    Good Morningu2026
    Could any one explain the importance of object dependency  type procedure and its uses with same scenario.
    Thanks in advance,
    Mohan M

    Hi Mohan,
    Procedures are used to infer values for charecterisitcs. These are a type of object dependencies used in VC.
    Procedures can overwrite defualt values or they can set defualt values for charecterisitcs,  several procedures can be assigned to an object (for eg. a BOM item or operation) and define processing sequence.
    These are maintained in Charecteristics, Charecteristic values, configuration profiles, BOM item, Routing operation etc.
    Eg: Processing Sequence:
    A configurable material has characteristics COLOR and PRESSURE. The following procedures are allocated to the configuration profile of the material.
    0010 $SELF.COLOR = u2018GREENu2019 IF PRESSURE >= 10
    0020 $SELF.COLOR = u2018YELLOWu2019 IF PRESSURE >= 50
    0030 $SELF.COLOR = u2018REDu2019 IF PRESSURE >= 100
    The sort sequence ensures that pressure greater than or equal to 100 always sets the color u2018redu2019.
    Inferring Charecteristic Values with procedures:
    Let's assume Configurable material BIKE has the following characteristics:
    CharacteristicS AND THEIR Values                 
    WEIGHT
    FRAME                                          Aluminum                  10 KG
                                                         Steel                           14 KG
    EXTRAS (multiple-value)              Mudguard                   0.5 kg
                                                          Luggage rack             1.0 kG
    Procedure
    1. Create a procedure for the weight of the BIKE, depending on the frame.
    2. This procedure has the following source code:
    $SELF. WEIGHT = 10 if FRAME = u2018Aluminumu2019,
    $SELF. WEIGHT = 14 if FRAME = u2018Steelu2019.
    3. Allocate the procedure to the configuration profile of material BIKE.
    The weight of a bicycle increases if you select additional extras, such as mudguard or luggage
    rack.
    1. You define a procedure with the following source code:
    $SELF.WEIGHT = $SELF.WEIGHT + 0.5 if EXTRAS = 'Mudguard',
    $SELF.WEIGHT = $SELF.WEIGHT + 1 if EXTRAS = 'Luggage rack'
    2. Allocate the procedure to the configuration profile of material BIKE.
    Result
    1. When you configure the bike, the value u2018Aluminumu2019 is selected for characteristic FRAME.
    This triggers the first procedure, which sets the value 10 kg as the WEIGHT.
    2. Characteristic EXTRAS has values u2018Mudguardu2019 and u2018Luggage racku2019. This triggers the
    second procedure, which increases the value of characteristic WEIGHT to 11.5 kg.
    You can also use procedures to count or summurize values of charecterisitics.
    You can use procedure to change the values in master data such as BOM / routing. and also to maintain default values.
    Hope this will be helpful to you. Any queries, Please post.
    Regards,
    Pavan

Maybe you are looking for

  • How Do I Share picture library with several users on my imac

    I would like to share the picture library between all users on my IMac. How is this possible?

  • Error in Premiere Element 10

    I used the Premiere Element 10 to edit some videos and lately encountered the following error repeatedly when I tried to render the project. I tried reinstalling the video clips and also uninstalled the program (Element 10) 3 times and re-installed i

  • Canon imagerunner C3200 problem - won't print

    Hi to all, I have searched this forum and not found this error/solution. We just switched from PC to Mac and of course all is heaven! Except one tiny issue - going crazy. We have installed the printer driver from Canon for all of our imagerunner prin

  • ADF Bounded Task Flow

    I have created a bounded task flow which has the following activities: Method Call (default activity and it calls a custom method in a request scoped backing bean), a controlFlow to a jsf page, a controlFlow to a Task Flow Return. Here is the xml cod

  • Passing Connection object from web tier to ejb tier

    I am having a multi threaded application where i am creating multiple threads and doing ejb lookup in each thread and there in ejb it is creating a database connection. But i wish to pass only a single connection so that total no of free connections