Poolman Object Pooling

Hello all,
I am having problems with CodeStudio's PoolMan. I need to create a pool of custom objects, but it keeps on saying that my object can not be found. I can use the exact same code and use java.lang.String as the pool type and it works great... any ideas would be great!
Here is the log file from my poolman startup...
October 3, 2001 1:26:30 PM EST: Creating 20 initial objects in pool UserChannelPool
October 3, 2001 1:26:30 PM EST: GenericPool: Exception while initializing
EXCEPTION: edu.iu.uis.my.web.UserChannel: java.lang.ClassNotFoundException: edu.iu.uis.my.web.UserChannel
java.lang.ClassNotFoundException: edu.iu.uis.my.web.UserChannel
     at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
     at java.lang.Class.forName0(Native Method)
     at java.lang.Class.forName(Class.java:120)
     at com.codestudio.util.GenericPool.create(GenericPool.java:110)
     at com.codestudio.util.ObjectPool.checkOut(ObjectPool.java:214)
     at com.codestudio.util.ObjectPool.init(ObjectPool.java:94)
     at com.codestudio.util.GenericPool.<init>(GenericPool.java:47)
     at com.codestudio.util.GenericPoolManager.createPool(GenericPoolManager.java:54)
     at com.codestudio.management.LocalPoolDeployer.startGenericPools(LocalPoolDeployer.java:137)
     at com.codestudio.management.LocalPoolDeployer.deployConfiguration(LocalPoolDeployer.java:31)
     at com.codestudio.management.PoolManBootstrap.<init>(PoolManBootstrap.java:72)
     at com.codestudio.util.GenericPoolManager.assertLoaded(GenericPoolManager.java:43)
     at com.codestudio.util.GenericPoolManager.requestObject(GenericPoolManager.java:82)
     at _0002findex_0002ejspindex_jsp_11._jspService(_0002findex_0002ejspindex_jsp_11.java:87)
     at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
     at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177)
     at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
     at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
     at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
     at org.apache.tomcat.core.Handler.service(Handler.java:286)
     at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
     at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
     at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
     at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)
     at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
     at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
     at java.lang.Thread.run(Thread.java:484)
October 3, 2001 1:26:30 PM EST: PoolMan Local Pool Deployer: Created Object Pool Named: UserChannelPool
Thanks!
Nate

Never assume always check A lesson I had drummed into me as a youngster. In this case your assumption is wrong, this exeption is always thrown if the class stated is not in the classpath. This particular classpath is Tomcats, not your client app. Drop the jar with the class in $TOMCAT_HOME$/webapps/[your root]/WEB-INF/lib.

Similar Messages

  • Object pool for DTO objects

    Hi,
    I am using BlazeDS to (de)serialize many identical small objects between a Flex client and a Java Servlet. For efficiency, I would like to create object pools on both sides. Is this possible with BlazeDS?
    Thank you,
    Andrej van der Zee

    Hi,
    Thanks for your reply.
    Are there any thoughts how I can do this on the client? As far as I can see, deserialization of DTOs is hidden in the remote object. How can I tell a remote object to use a factory method for creating certain DTOs? 
    Cheers,
    Andrej
    On Sat, Jan 17, 2009 at 3:37 AM, Alex Glosband
    <
    [email protected]> wrote:
    A new message was posted by Alex Glosband in
    General Discussion --
      Object pool for DTO objects
    Hi Andrej,
    The answer is no. There aren't any object pooling features in BlazeDS for pooling DTOs, either on the client or the server. If there are any third party object pooling solutions for DTOs on the server though you could maybe hook one of them in. . . either in your Java servlet or a RemoteObject. . . but I think anything on the client you would have to write yourself.
    -Alex
    View/reply at
    Object pool for DTO objects
    Replies by email are OK.
    Use the
    unsubscribe form to cancel your email subscription.
    Andrej van der Zee
    2-40-19 Koenji-minami
    Suginami-ku, Tokyo
    166-0003 JAPAN
    Mobile: +81-(0)80-65251092
    Phone/Fax: +81-(0)3-3318-3155

  • Is object pooling still necessary?

    I&#8217;ve have implemented a transport server in Java, which creates many objects of the same type. In consideration of the compiler improvements does it make sense to use object pools like http://jakarta.apache.org/commons/pool/ nowadays?
    What do you thing?
    Thx,
    Chris

    Or only very rarely. Only if you have an object that is particularly
    costly to create, e.g. a state machine for a parsing or
    cryptographic engineIt is quite interesting though. I built a parser recently, and pooled the state-machines. However, I did all allocation for buffers (byte[]) on demand.
    Performance wasn't great - so I created an allocator interface - and put my HeapAllocator head-to-head with a PooledAllocator.
    Bang: 35% performance improvement with pooling.

  • Java object pooling

    Hi all,
    Is there an Object pooling mechanism available in J2SE?
    Does anyone know of any good open source object pooling implementation?
    Thanks in advance

    Unfortunately, the Jakarta's object pool is very ineffective for objects requiring a long construction time.
    The pool can grow dynamically (when no idle object available for allocation and pool is not exhausted yet) and new objects might be constructed inside borrow method. Since the borrow as well as the freeObject are both synchronized (on the pool instance' lock), all other waiting clients will have to wait for that lock to be released before they can either release used object or borrow one.
    Bottom line, you better not use this pooling API for pooling objects such as connections which have a very long construction time.
    I built a very efficient object pool and will be glad to share it with others.
    Just tell me where can i post it

  • RMI Server Object Pooling

    Hello All,
    Does WLServer6.1 take care of having a pool of RMI Server objects, similar
    to the way EJB container does it for EJBs. I guess what I am trying to
    achieve is an effect of Servlets that spawn light threads per invocation
    though now using RMI Server Object. I did look at the "executeThreadPool"
    options which would allow for increasing performance. I am not 100%
    satisfied with it though. Is there any way I can do this. Thanks,
    Chirag

    "Pyung Yoon" <[email protected]> writes:
    MediatorInterface mediator = (MediatorInterface) java.rmi.Naming.lookup("rmi://localhost:7001/TestMediator);This implies JRMP which the server does not support. You need to use t3 or iiop.
    andy

  • Fundamental questions on Object pooling

    Hi,
    I ve a class which exposes only utility methods and objects of it wont have any state at any point of time. Now which pattern should I use here...1. Can I go for Singleton pattern so that all calling classes will work on same instance in one JVM? 2. Each calling class will create one instance use it and nullify it? 3. Expose all utility methods as static methods so no physical instance in JVM as no state is needed.?
    Would having only one instance degrade the performance or boost in case of having a new instance everytime?
    Please share ur views on this. Pros and Cons on each pattern.
    Thanks in advance
    JoyBoy

    Hey Chris,
    For transporting objects either in IR / ID prerequisite is that you must have already configured your XI Track properly using landscape configurator as it defines the transport route for the corresponding XI objects based on the <b>s/w component version</b>.
    As for ID doesn't have any s/w component version we define <b>SAPINTDIR 3.0</b> as s/w comp. It refers to all the objects in the ID.
    <b>
    FOR Integration Directory transport  Test(Consolidation)->Prod:</b>
    When the objects are transported from test to productive landsape unless any changes have been made to the objects in the test landscape all the objects can be transported to the id with out any complexity. CMS takes cares of conversion of the business system to that of prod if required. Usual convention that is followed is to maintain same naming schema for the objects.
    cheers.
    Raj.

  • Object pooling

    This question was posted in response to the following article: http://help.adobe.com/en_US/as3/mobile/WS948100b6829bd5a6-19cd3c2412513c24bce-8000.html

    replace IntroView with any class name you want to pool:
    public class IntroView_Pool {
                  private static var pool:Vector.<IntroView>;
                  public static function init(poolSize:int):void {
                         pool = new Vector.<IntroView>(poolSize);
                         for(var i:int=0;i<pool.length;i++){
                               pool[i] = new IntroView();
                  public static function retrieveF():IntroView {
                         if (pool.length>0) {
                               return pool.pop();
                         } else {
                               // this branch should not execute. 
                               return new IntroView();
                  public static function returnF(view:IntroView):void {
                         pool.push(view);

  • Connection pooling of SOAPConnection objects

    We have a requirement to pass SOAP Message to the Web service server. Currently we are creating the SOAP messages using SAAJ (SOAP with attachments API for java) APIs provided by SUN. The external system from where we are consuming the webservices has 2 Web servers behind a load balancer to serve the SOAP request. We are using SOAPConnection API of the javax.xml.soap package for connecting to the Web Service. Using this we are able to create SOAPMessage and send to Web Service for execution.
    However, the requirement is to create a Connection Pool with the SOAP connections to the Web Service. To do this, we need some clarification
    1) Is it worth creating SOAP connection (object) pool with SOAPConnection object? Because, as per the API, the actual connection to the webservice takes only when call() method of the SOAPConnection is invoked.In the same method call the connection and message passing to Web Service service is happening.
    2) Is there any techniques in java to pass SOAP Message over HTTP which facilitates connection pooling aswell?

    Is this for inserts/updates or for selects.
    do you get this with a single object bind (in preference to binding each attribute individually)
    Dom

  • How to add new increase the pool rather then trowing a error.

    Im trying to build a game and after many attempts and hours of thinking i did manage to create something that looks like a game.The problem now is that there are so many objects that are constantly creating and removing from the stage. that the game is starting to slow down(it is laggy.).So i have searched the net and understood that i will have to use a "Object pooling Method" rather than creating and removing the objects after i dont have any use of them any more, if i want to make the game more memory friendly.
    At first i didnt want to use this method (object pooling) ,but after a while i understood that i dont have a lot of options.So i started to search how and why and how.
    Yet in this example im just trying this for the bullets (for now) cause if i can do it for them, i can manage to do it for other objects and projects (it will be simple for me to understand what is happening ., what am i doing , when do i add an existing object from the pool and when im creating a new one(when there are non left, things like this)
    i did copy some part of this code from a tutorial that i found in the net but , from then i dont know how to increase the pool rather than throwing this error. I did try to create a new object or to increase the pool length but .... it is not working so im sure that im not doing something the way it must be done.
    so i have this so far :
    its a "simple" pool that calls a simple shape class (circle dot) and gives that to the main stage when the "SPACE" button is pressed
    package
              import flash.display.Sprite;
              import flash.events.Event;
              import flash.display.Bitmap;
              import flash.display.BitmapData;
              import flash.display.Shape;
              public class Bullet extends Sprite{
                        public var  rectangle:Shape = new Shape();
                        public function Bullet(){
                                  super();
                                  addEventListener(Event.ADDED_TO_STAGE, init);
                                  graphics.beginFill(0xFF0000);
                                  graphics.drawRect(-5, -5, 10,10);
                                  graphics.endFill();
                        private function init(event:Event):void{
    the SpritePool where i cant figure out how to replace the throw new error with some new code that will increase the pool
    package {
              import flash.display.DisplayObject;
              public class SpritePool {
                        private var pool:Array;
                        private var counter:int;
                        public function SpritePool(type:Class, len:int) {
                                  pool = new Array();
                                  counter = len;
                                  var i:int = len;
                                  while (--i > -1) {
                                            pool[i] = new type();
                        public function getSprite():DisplayObject {
                                  if (counter > 0) {
                                            return pool[--counter];
                                  } else {
                                            throw new Error("You exhausted the pool!");
                        public function returnSprite(s:DisplayObject):void {
                                  pool[counter++] = s;
    and the Game class (the documents class)
    package {
              import flash.ui.Keyboard;
              import flash.display.Sprite;
              import flash.events.Event;
              import flash.events.KeyboardEvent;
              import flash.display.Bitmap;
              import flash.display.BitmapData;
              import flash.display.Shape;
              public class Game extends Sprite {
                        private var ship:Shape;
                        private var bullets:Array;
                        private var pool:SpritePool;
                        public function Game() {
                                  Assets.init();
                                  addEventListener(Event.ADDED_TO_STAGE, init);
                        private function init(event:Event):void {
                                  pool = new SpritePool(Bullet,10);
                                  bullets = new Array();
                                  ship = new Shape();
                                  ship.graphics.beginFill(0xFF00FF);
                                  ship.graphics.drawRect(0,0, 60, 60);
                                  ship.graphics.endFill();
                                  ship.x = stage.stageWidth / 2 - ship.width / 2;
                                  ship.y = stage.stageHeight - ship.height;
                                  addChild(ship);
                                  stage.addEventListener(KeyboardEvent.KEY_DOWN, onDown);
                                  addEventListener(Event.ENTER_FRAME, loop);
                        private function onDown(event:KeyboardEvent):void {
                                  if (event.keyCode == Keyboard.SPACE) {
                                            var b:Bullet = pool.getSprite() as Bullet;
                                            b.x = ship.x + ship.width / 2;
                                            b.y = ship.y;
                                            addChild(b);
                                            bullets.push(b);
                                            trace("Bullet fired");
                        private function loop(event:Event):void {
                                  for (var i:int=bullets.length-1; i>=0; i--) {
                                            var b:Bullet = bullets[i];
                                            b.y -=  10;
                                            if (b.y < 0) {
                                                      bullets.splice(i, 1);
                                                      removeChild(b);
                                                      pool.returnSprite(b);
                                                      trace("Bullet disposed");
    any suggestions/help how to do it

    To put you on the path (the errors/events needs formalization), here would be a quick example. Your pool class:
    package
              import flash.display.DisplayObject;
              public class SpritePool
                        private var pool:Array;
                        private var counter:int;
                        private var classRef:Class;
                        // public get to know what's left in the pool
                        public function get availableObjects():int
                                  return counter;
                        public function SpritePool(type:Class, len:int)
                                  classRef = type;
                                  pool = new Array();
                                  counter = len;
                                  var i:int = len;
                                  while (--i > -1)
                                            pool[i] = new classRef();
                        public function getSprite():DisplayObject
                                  if (counter > 0)
                                            return pool[--counter];
                                  else
                                            throw new Error("PoolExhausted");
                        public function returnSprite(s:DisplayObject):void
                                  pool[counter++] = s;
                        public function increasePool(amount:int):void
                                  counter += amount;
                                  while (--amount > -1)
                                            pool.push(new classRef());
                        public function decreasePool(amount:int):void
                                  if (counter >= amount)
                                            counter -= amount;
                                            pool.splice(counter - amount,amount);
                                  else
                                            throw new Error("PoolDecreaseFail");
    Now you'd need to be catching those errors. Again, the errors should be formalized or you could use events by extending IEventDispatcher. I kept it simple.
    Here would be the simple Bullet class I'm using:
    package
              import flash.display.Sprite;
              public class Bullet extends Sprite
                        private var bullet:Sprite;
                        public function Bullet():void
                                  var bullet:Sprite = new Sprite();
                                  bullet.graphics.beginFill(0xFF0000,1);
                                  bullet.graphics.drawCircle(-5,-5,10);
                                  bullet.graphics.endFill();
                                  addChild(bullet);
    Just draws a red circle just to visualize it..
    Here would be a full example of using it. It will import both of these classes (saved as SpritePool.as and Bullet.as in the same folder). Paste this in the actions panel on frame 1:
    import SpritePool;
    import Bullet; // a simple red 10px circle
    import flash.display.Sprite;
    import flash.utils.setTimeout;
    // fill the pool, swim trunks optional
    var pool:SpritePool = new SpritePool(Bullet, 10);
    // grab some objects from the pool
    // array of currently held objects
    var myBullets:Array = new Array();
    while (pool.availableObjects > 0)
              myBullets.push(pool.getSprite());
    // display in random positions
    for (var i:int = 0; i < myBullets.length; i++)
              addChild(myBullets[i]);
              // position
              myBullets[i].x = int(Math.random()*stage.stageWidth);
              myBullets[i].y = int(Math.random()*stage.stageHeight);
    trace("myBullets has " + myBullets.length + " bullets! pool has " + pool.availableObjects + " left.");
    // now I want one more, but I should check for errors
    try
              // fail, none left!
              myBullets.push(pool.getSprite());
    catch (e:*)
              // this should be a custom event, but for speed, quick and dirty
              if (e == 'Error: PoolExhausted')
                        trace("D'oh no more bullets! I need more!");
                        pool.increasePool(10);
                        trace("Added 10 more, now available in pool " + pool.availableObjects);
    // try to reduce the pool by 15, which should error
    try
              pool.decreasePool(15);
    catch (e:*)
              // again should be a formal error
              if (e == 'Error: PoolDecreaseFail')
                        trace("Oops, can't reduce pool by 15! Let's trim all extras, available is " + pool.availableObjects);
                        // we know it'll work, no error checking
                        pool.decreasePool(pool.availableObjects);
                        trace("Left in pool: " + pool.availableObjects);
    // now lets wait 5 seconds and remove it all back to the pool
    setTimeout(ReturnToPool,5000);
    function ReturnToPool():void
              // now let's just return all the objects to the pool
              while (myBullets.length > 0)
                        removeChild(myBullets[myBullets.length - 1]);
                        pool.returnSprite(myBullets.pop());
              // now check the pool, should have 10
              trace("Amount of bullets in use " + myBullets.length + ", in pool " + pool.availableObjects);
    For ease you can just download my example source (saved down to CS5).
    Anything from here is just symantics. For example instead of throwing an error because the pool is too small you could simply increase the pool by a fixed amount yourself and return the objects requested.
    To keep objects as low as possible you could use a timer to measure the amount of objects in use over a duration and reduce the pool appropriately, knowing the pool will grow as it needs.
    All of this is just to avoid unnecessary object creation.
    BTW here's my trace which should match yours:
    myBullets has 10 bullets! pool has 0 left.
    D'oh no more bullets! I need more!
    Added 10 more, now available in pool 10
    Oops, can't reduce pool by 15! Let's trim all extras, available is 10
    Left in pool: 0
    (after 5 seconds)
    Amount of bullets in use 0, in pool 10

  • Thread pool rejecting threads when I don't think it should, ideas?

    Hi,
    I have a server application in which I only want a specific number of simultaneous requests. If the server gets more then this number it is suppose to close the connection (sends an HTTP 503 error to the client). To do this I used a fix thread pool. When I start the server and submit the max number of requests I get the expected behavior. However if I resubmit the request (within a small period of time, e.g. 1-15 seconds after the first one) I get very odd behavior in that some of the requests are rejected. For example if I set the max to 100 the first set of requests will work fine (100 requests, 100 responses). I then submit again and a small number will be rejected (I've seen it range from 1 to 15 rejected)....
    I made a small app which kind of duplicates this behavior (see below). Basically when I see is that the first time submitting requests works fine but the second time I get a rejected one. As best as I can tell none should be rejected....
    Here is the code, I welcome your thoughts or if you see something I am doing wrong here...
    <pre>
    import java.util.concurrent.*;
    import java.util.concurrent.atomic.AtomicInteger;
    public class ThreadPoolTest {
         static AtomicInteger count = new AtomicInteger();
         public static class threaded implements Runnable {
              @Override
              public void run() {
                   System.out.println("In thread: " + Thread.currentThread().getId());
                   try {
                        Thread.sleep(500);
                   } catch (InterruptedException e) {
                        System.out.println("Thread: " + Thread.currentThread().getId()
                                  + " interuptted");
                   System.out.println("Exiting run: " + Thread.currentThread().getId());
         private static int maxThreads = 3;
         private ThreadPoolExecutor pool;
         public ThreadPoolTest() {
              super();
              pool = new java.util.concurrent.ThreadPoolExecutor(
                        1, maxThreads - 1, 60L, TimeUnit.SECONDS,
                        new ArrayBlockingQueue<Runnable>(1));
         public static void main(String[] args) throws InterruptedException {
              ThreadPoolTest object = new ThreadPoolTest();
              object.doThreads();
              Thread.sleep(3000);
              object.doThreads();
              object.pool.shutdown();
              try {
                   object.pool.awaitTermination(60, TimeUnit.SECONDS);
              } catch (InterruptedException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
         private void doThreads() {
              int submitted = 0, rejected = 0;
              int counter = count.getAndIncrement();
              for (int x = 0; x < maxThreads ; x++) {
                   try {
                        System.out.println("Run #: " + counter + " submitting " + x);
                        pool.execute(new threaded());
                        submitted++;
                   catch (RejectedExecutionException re) {
                        System.err.println("\tRun #: " + counter + ", submission " + x
                                  + " was rejected");
                        System.err.println("\tQueue active: " + pool.getActiveCount());
                        System.err.println("\tQueue size: " + pool.getPoolSize());
                        rejected++;
              System.out.println("\n\n\tRun #: " + counter);
              System.out.println("\tSubmitted: " + (submitted + rejected));
              System.out.println("\tAccepted: " + submitted);
              System.out.println("\tRejected: " + rejected + "\n\n");
    </pre>

    First thank you for taking the time to reply, I do appreciate it.
    jtahlborn - The code provided here is a contrived example trying to emulate the bigger app as best as I could. The actual program doesn't have any sleeps, the sleep in the secondary thread is to simulate the program doing some work & replying to a request. The sleep in the primary thread is to simulate a small delay between 'requests' to the pool. I can make this 1 second and up to (at least) 5 seconds with the same results. Additionally I can take out the sleep in the secondary thread and still see the a rejection.
    EJP - Yes I am aware of the TCP/IP queue, however; I don't see that as relevant to my question. The idea is not to prevent the connection but to respond to the client saying we can't process the request (send an "HTTP 503" error). So basically if we have, say, 100 threads running then the 101st, connection will get a 503 error and the connection will be closed.
    Also my test platform - Windows 7 64bit running Java 1.6.0_24-b07 (32bit) on an Intel core i7.
    It occurred to me that I did not show the output of the test program. As the output shows below, the first set of requests are all processed properly. The second set of requests is not. The pool should have 2 threads and 1 slot in the queue, so by the time the second "request" is made at least 2 of the requests from the first call should be done processing, so I could possibly understand run 1, submit #2 failing but not submit 1.
    <pre>
    Run #: 0 submitting 0
    Run #: 0 submitting 1
    Run #: 0 submitting 2
    In thread: 8
    In thread: 9
    Exiting run: 8
    Exiting run: 9
         Run #: 0
         Submitted: 3
         Accepted: 3
         Rejected: 0
    In thread: 8
    Exiting run: 8
    Run #: 1 submitting 0
    In thread: 9
    Run #: 1 submitting 1
         Run #: 1, submission 1 was rejected
         Queue active: 1
         Queue size: 2
    Run #: 1 submitting 2
         Run #: 1
         Submitted: 3
         Accepted: 2
         Rejected: 1
    In thread: 8
    Exiting run: 9
    Exiting run: 8
    </pre>

  • Creating objects and efficiency

    I am implementing bounding circles for my game and I have a question. I have heard that creating a new object takes up a lot of time (i.e doing it every update). Should I give each of my objects a BoundingSphere instance variable (I created my own simple BoundingSphere class), update it's position every update along with the sprite, or should I remove the instance variable and just return a new BoundingSphere when it is requested?
    Just to clarify:
    Implementation 1:
    private BoundingSphere s;
    public BoundingSphere getBoundingSphere() {
       return s;
    //update s each time sprite is updatedImplementation 2:
    //no private instance variable
    public BoundingSphere getBoundingSphere() {
       return new BoundingSphere(radius, x, y);

    If you know a maximum bound on how many of the created objects you'll need at any given time, you can prevent lots of object creation by implementing an object pool. The pool keeps a list of pre-constructed objects, and to use it, a method may request an object, use a method to initialize its values (not a constructor), then release it back to the pool when it is done using it. This is usually done with Threads to limit the number of them running, but it can be done with any object.
    I hope this helps
    -JBoeing

  • How many Objects created??

    Hi Friends,
    I am really confused with this question,can someone please tell me how many objects would be created by the following code??My answer is two("java" on the heap and the normal new String() Object),am i right???
    public class Objects{  
    public static void main(String[] args)    {   
        String one = "Java";    
        String two = "Java";   
        String three = "J" + "a" + "v" + "a"; 
        String four = new String("Test");  
    }Thanks

    Probably not, since all the operands are string
    literals. The compiler probably sees that and instead
    generates the same bytecode that it would have if it
    had been coded as: "Java" in the first place. But
    again, still stupid and pointless.just what i wanted to say but was a bit slow. maybe it's stupid and pointless,
    but for grins, i am attaching the constants pool from the class file that was
    obtained by compiling the code in post 1 with Sun's compiler. I don't see any
    "J" or "a" or .........
    pool index: 1 type: 10 class index: 7 name index: 16 value: null
    pool index: 2 type: 8 class index: -1 name index: 17 value: null
    pool index: 3 type: 7 class index: -1 name index: 18 value: null
    pool index: 4 type: 8 class index: -1 name index: 19 value: null
    pool index: 5 type: 10 class index: 3 name index: 20 value: null
    pool index: 6 type: 7 class index: -1 name index: 21 value: null
    pool index: 7 type: 7 class index: -1 name index: 22 value: null
    pool index: 8 type: 1 class index: -1 name index: -1 value: <init>
    pool index: 9 type: 1 class index: -1 name index: -1 value: ()V
    pool index: 10 type: 1 class index: -1 name index: -1 value: Code
    pool index: 11 type: 1 class index: -1 name index: -1 value: LineNumberTable
    pool index: 12 type: 1 class index: -1 name index: -1 value: main
    pool index: 13 type: 1 class index: -1 name index: -1 value: ([Ljava/lang/String;)V
    pool index: 14 type: 1 class index: -1 name index: -1 value: SourceFile
    pool index: 15 type: 1 class index: -1 name index: -1 value: Objects.java
    pool index: 16 type: 12 class index: 9 name index: 8 value: null
    pool index: 17 type: 1 class index: -1 name index: -1 value: Java
    pool index: 18 type: 1 class index: -1 name index: -1 value: java/lang/String
    pool index: 19 type: 1 class index: -1 name index: -1 value: Test
    pool index: 20 type: 12 class index: 23 name index: 8 value: null
    pool index: 21 type: 1 class index: -1 name index: -1 value: Objects
    pool index: 22 type: 1 class index: -1 name index: -1 value: java/lang/Object
    pool index: 23 type: 1 class index: -1 name index: -1 value: (Ljava/lang/String;)Vwalker

  • POOL & CLUSTER TABLEs

    Hi Experts,
    Can you send me some example tables for pool and cluster tables..
    And where exactly you use these tables in real time..
    Kindly reply me as early as possible
    Thanks in advance
    Santosh

    Hi santosh,
    Go to se11
    table DD02L-> Give TABCLASS as POOL or CLUSTER you will get a list of tables
    Pooled and Cluster Tables
    Table pools (pools) and table clusters (clusters) are special table types in the ABAP Dictionary. The data from several different tables can be stored together in a table pool or table cluster. Tables assigned to a table pool or table cluster are referred to as pooled tables or cluster tables.
    A table pool or table cluster should be used exclusively for storing internal control information (screen sequences, program parameters, temporary data, continuous texts such as documentation). Data of commercial relevance is usually stored in transparent tables.
    Table Pools
    A table in the database in which all records from the pooled tables assigned to the table pool are stored corresponds to a table pool.
    The definition of a pool consists essentially of two key fields (Tabname and Varkey) and a long argument field (Vardata). A pool has the following structure:
    Field
    Data type
    Meaning
    Tabname
    CHAR(10)
    Name of pooled table
    Varkey
    CHAR (n)
    Contains the entries from all key fields of the pooled table record as a string, max. length for n is 110
    Dataln
    INT2(5)
    Length of the string in Vardata
    Vardata
    RAW (n)
    Contains the entries from all data fields of the pooled table record as a string, max. length n depends on the database system used
    If a pooled table record is saved, it is stored in the table pool assigned. The name of the pooled table is written to the field Tabname. The contents of all key fields of the pooled table are written as a string to field Varkey and the contents of all data fields as a string to field Vardata. The length of the string stored in Vardata is entered in field Dataln by the database interface.
    Due to the structure of a table pool, there are certain restrictions on the pooled tables assigned to it. The name of a pooled table may not exceed 10 characters. Since Varkey is a character field, all key fields of a pooled table must have character data types (for example, CHAR, NUMC, CLNT). The total length of all key fields or all data fields of a pooled table must not exceed the length of the Varkey or Vardata field of the assigned pool.
    Table Clusters
    Several logical data records from different cluster tables can be stored together in one physical record in a table cluster.
    A cluster key consists of a series of freely definable key fields and a field (Pageno) for distinguishing continuation records. A cluster also contains a long field (Vardata) that contains the contents of the data fields of the cluster tables for this key. If the data does not fit into the long field, continuation records are created. Control information on the structure of the data string is still written at the beginning of the Vardata field. A table cluster has the following structure:
    Field
    Data type
    Meaning
    CLKEY1
    First key field
    CLKEY2
    Second key field
    CLKEYn
    nth key field
    Pageno
    INT2(5)
    Number of the continuation record
    Timestamp
    CHAR(14)
    Time stamps
    Pagelg
    INT2(5)
    Length of the string in Vardata
    Vardata
    RAW (n)
    Contains the entries from the data fields of the assigned cluster tables as a string, max. length n depends on the database system used
    The records of all cluster tables with the same key are stored under one key in the assigned table cluster. The values of the key fields are stored in the corresponding key fields of the table cluster. The values of all data fields of the assigned cluster tables are written as a string to the Vardata field of the table cluster. Besides the actual data values, the data string contains information on the structure of the data and which table it comes from. If the string exceeds the maximum length of the Vardata field, a continuation record is written with the same key values. The continuation records for a key are distinguished by their value in field Pageno. The actual length of the string in the Vardata field is stored in the Pagelg field by the database interface.
    You need the structural information stored in the ABAP Dictionary to read the data from a pooled table or cluster table correctly. These tables can therefore only be processed using Open SQL with the cluster interface, and not with Native SQL directly in the database.
    In Repository informatino SE84 goto ABAP Dictonary -> Other Objects -> Pooled and clustered tables -> And then execute. It will give the list of available pooled/clustered tables.
    For further reference check the SAP help document...
    http://help.sap.com/saphelp_erp2005/helpdata/en/cf/21ea0b446011d189700000e8322d00/frameset.htm
    regards,
    keerthi

  • Data Queue/Pool Design

    I am trying to writing a data-retrieval program for my data server. In my design, the server will keep on generating data continuously. Now I want that whenever client side user connects to server, if the server has any already generated data, it will get ALL available data back; and if user has not connected to server to get data, all the generated data will be kept in a Data Queue/Pool and waiting for user to retrieve them at a later time. - I think this is very similar to mail program.
    My question is how to design such a Data Queue/Pool? There are two main problem here: 1). Just like mail server, different user may have different data, so each user must have a data pool ( for him/her to retrieve), so how to keep data for different user?
    2). When user is retrieving data, at the same time, the data may be adding to the pool, so how to prevent data lost?
    Any one can show me some code fragment of such Queue/pool?
    Many thanks!

    If a got you right (i may repeat you anyway) you have:
    1. A set of users
    2. For every user there is some data (that is in genereal collected)
    3. When user connects all available data is send to him and removed from the server.
    If this is the case than:
    1. Write some queue (lets name it Que) that holds a data for a given user. This queue has two main mathods:
    - putData - that you use to store data in queue
    - getAllData - that removes all data from the queue and returns it to the caller...
    These two methods are synchronized... (probably you will use some collection class, like List or Set, in this Que to keep data)...
    When server ganarates some data use putData method... When user connects use getAllData method... this is of course obvious to you :)))
    2. You must have some kind of user management... maybe you will use Map to retrieve Que for given user name - you can make this as you wish...
    There is one another thing that came to my mind while i was reading your post... What will happen if server generates a lot of data... Than for you good you should use hdd to keep data and may by some kind of object pools... but that is not important for the moment... :)))

  • OGG-01028  ACTIVE OBJECT COUNT MISMATCH.

    HI,
    Please see the following message in my report for extract.
    2011-08-23 12:42:34 INFO OGG-01513 Positioning to Sequence 1144827, RBA 41763856.
    2011-08-23 12:42:34 INFO OGG-01516 Positioned to Sequence 1144827, RBA 41763856, Aug 22, 2011 11:17:08 AM.
    2011-08-23 12:42:34 INFO OGG-01055 Recovery initialization completed for target file /ggate/dirdat/d1000329, at RBA 945.
    2011-08-23 12:42:34 INFO OGG-01478 Output file /ggate/dirdat/d1 is using format RELEASE 10.4/11.1.
    2011-08-23 12:42:34 INFO OGG-01026 Rolling over remote file /ggate/dirdat/d1000329.
    2011-08-23 12:42:34 INFO OGG-01053 Recovery completed for target file /ggate/dirdat/d1000330, at RBA 945.
    2011-08-23 12:42:34 INFO OGG-01057 Recovery completed for all targets.
    ** Run Time Messages **
    2011-08-23 12:42:34 INFO OGG-01517 Position of first record processed Sequence 1144827, RBA 41763856, SCN 8.2631617714,
    Aug 22, 2011 11:17:08 AM.
    2011-08-23 12:45:32 INFO OGG-01644 BOUNDED RECOVERY: COMPLETE: for object pool 1: p37409352_extr at SeqNo: 1145221, RBA:
    20970512, SCN: 8.2648273321 (37008011689).
    *2011-08-23 12:45:32 WARNING OGG-01632 CM_op_validate_active_objects_count(const op_t *): Active object count differs from c*
    ount from previous instance BCP: OP active count: 148  recovered count from previous BCP: 146  pool instance: 1 (p37409352_ex
    tr).
    *2011-08-23 12:45:32 ERROR OGG-01028 ACTIVE OBJECT COUNT MISMATCH.*
    * ** Run Time Statistics ** *
    Report at 2011-08-23 12:45:32 (activity since 2011-08-23 12:42:32)
    Output to /ggate/dirdat/d1:
    No records extracted.
    *2011-08-23 12:45:32 ERROR OGG-01668 PROCESS ABENDING.*
    *2011-08-23 12:45:32 WARNING OGG-00543 Unexpected threading library failur*
    My extract is getting abended with the above error.... Please help...
    Regards,
    Jibu

    Same error here.
    Occured when I force stop replicat in order to add extra table.
    Solution revert changes, wait until long transaction finish so I can stop replica normally (not forced).
    Replication now is ok.
    2012-06-25 09:58:28  INFO    OGG-00963  Oracle GoldenGate Manager for Oracle, mgr.prm:  Command received from GGSCI on host 66.66.66.66 (START EXTRACT esp01 ).
    2012-06-25 09:58:28  INFO    OGG-00975  Oracle GoldenGate Manager for Oracle, mgr.prm:  EXTRACT esp01 starting.
    2012-06-25 09:58:28  INFO    OGG-00992  Oracle GoldenGate Capture for Oracle, esp01.prm:  EXTRACT esp01 starting.
    2012-06-25 09:58:30  INFO    OGG-01639  Oracle GoldenGate Capture for Oracle, esp01.prm:  BOUNDED RECOVERY:  ACTIVE: for object pool 1: p17983_extr.
    2012-06-25 09:58:30  INFO    OGG-01640  Oracle GoldenGate Capture for Oracle, esp01.prm:  BOUNDED RECOVERY: recovery start XID: 22.19.4625531.
    2012-06-25 09:58:30  INFO    OGG-01641  Oracle GoldenGate Capture for Oracle, esp01.prm:  BOUNDED RECOVERY: recovery start position: SeqNo: 163671, RBA: 228929552, SCN: 2663.1788286646 (11439286195894), Timestamp: 2012-06-25 08:10:12.000000.
    2012-06-25 09:58:30  INFO    OGG-01642  Oracle GoldenGate Capture for Oracle, esp01.prm:  BOUNDED RECOVERY: recovery end position: SeqNo: 163671, RBA: 329908200, SCN: 2663.1789358330 (11439287267578), Timestamp: 2012-06-25 08:11:26.000000.
    2012-06-25 09:58:30  INFO    OGG-01579  Oracle GoldenGate Capture for Oracle, esp01.prm:  BOUNDED RECOVERY: VALID BCP: CP.esp01.000000996.
    2012-06-25 09:58:30  INFO    OGG-01629  Oracle GoldenGate Capture for Oracle, esp01.prm:  BOUNDED RECOVERY: PERSISTED OBJECTS RECOVERED: 1.
    2012-06-25 09:58:32  INFO    OGG-01513  Oracle GoldenGate Capture for Oracle, esp01.prm:  Positioning to Sequence 163671, RBA 228929552.
    2012-06-25 09:58:32  INFO    OGG-01516  Oracle GoldenGate Capture for Oracle, esp01.prm:  Positioned to Sequence 163671, RBA 228929552, Jun 25, 2012 8:10:12 AM.
    2012-06-25 09:58:33  INFO    OGG-00993  Oracle GoldenGate Capture for Oracle, esp01.prm:  EXTRACT esp01 started.
    2012-06-25 09:58:33  INFO    OGG-01055  Oracle GoldenGate Capture for Oracle, esp01.prm:  Recovery initialization completed for target file ./dirdat/ei012794, at RBA 47844316.
    2012-06-25 09:58:33  INFO    OGG-01478  Oracle GoldenGate Capture for Oracle, esp01.prm:  Output file ./dirdat/ei is using format RELEASE 10.4/11.1.
    2012-06-25 09:58:34  INFO    OGG-01026  Oracle GoldenGate Capture for Oracle, esp01.prm:  Rolling over remote file ./dirdat/ei012794.
    2012-06-25 09:58:34  INFO    OGG-01053  Oracle GoldenGate Capture for Oracle, esp01.prm:  Recovery completed for target file ./dirdat/ei012795, at RBA 965.
    2012-06-25 09:58:34  INFO    OGG-01057  Oracle GoldenGate Capture for Oracle, esp01.prm:  Recovery completed for all targets.
    2012-06-25 09:58:35  INFO    OGG-01517  Oracle GoldenGate Capture for Oracle, esp01.prm:  Position of first record processed Sequence 163671, RBA 228929552, SCN 2663.1788286614, Jun 25, 2012 8:10:12 AM.
    2012-06-25 09:58:41  INFO    OGG-01644  Oracle GoldenGate Capture for Oracle, esp01.prm:  BOUNDED RECOVERY: COMPLETE: for object pool 1: p17983_extr at SeqNo: 163671, RBA: 329908200, SCN: 2663.1789358331 (11439287267579).
    2012-06-25 09:58:41  WARNING OGG-01632  Oracle GoldenGate Capture for Oracle, esp01.prm:  CM_op_validate_active_objects_count: Active object count differs from count from previous instance BCP: OP active count: 18  recovered count from previous BCP: 17  pool instance: 1 (p17983_extr).
    2012-06-25 09:58:41  WARNING OGG-01027  Oracle GoldenGate Capture for Oracle, esp01.prm:  List: 0.
    2012-06-25 09:58:41  ERROR   OGG-01028  Oracle GoldenGate Capture for Oracle, esp01.prm:  ACTIVE OBJECT COUNT MISMATCH.
    2012-06-25 09:58:41  ERROR   OGG-01668  Oracle GoldenGate Capture for Oracle, esp01.prm:  PROCESS ABENDING.

Maybe you are looking for

  • PDF secured in v. 6 won't open in 9.2

    I have an ebook that I'd like to read.  However, it was created as a secure adobe 6.0 pdf.  Reader 9.2 won't open the file. I've talked to the book publisher and was told that I needed to uninstall v.9.2, install v 6 then reinstall 9.2 in order to re

  • Shared workbook in excel 2010

    I have a shared workbook with individual sheets for each project within the team. I need to review any changes they make to their sheets as this information is used elsewhere. When there is a newproject, I need to copy the template. The problem is th

  • Is this possible via SQL or not ?

    Hi There I have a scenario. Am not sure if this is possible via SQL or not. For Example Consider two tables T1 product_id location_id stock A 1 100 T2 product_id location_id aging_phase received_qty A 1 1 20 A 1 2 30 A 1 3 70 Now in T1 there is actua

  • MS SQL Server and OWB

    Hello All, SQL Server is on Windows and our target warehouse is on Unix. Now i want to use Hetrogenous Service of oracle to pull data which requires me to connect to system dsn. Now i create a system dsn in windows. How should the HS_FDS_CONNECT_INFO

  • Problem with N900' browser- "Update Flash Player" ...

    My Default browser doesnt play online VDO's anymore. It tells me get Flash player from Adobe site. When I go there and when I downloaded the ".deb" file. The package didnt install properly and gave an error. What should I do? NLobo