Power to Build

Home » Posts tagged 'EA Server'

Tag Archives: EA Server

Sybase EAServer: Taking Control -Object Pooling


Memory/Object Pooling
Memory allocation is an expensive task in any system. Whether it’s a C program doing malloc or a Java program creating objects on the fly, the system has to constantly go to memory handler and request for more memory. Releasing used memory was also a problem, it took resources, and not releasing properly caused memory leaks. Java came up with Garbage collection (gc), but even this uses a lot of resources, if not setup properly.

In a heavily used system, this means the system will be spending considerable amount of time in object creation and destruction (this will be done by Garbage collection). To alleviate this problem, some type of pooling (or caching) method is often used. Simply put, this is where memory released is held in a pool and reused when the next person asks for it. This way we reduce the number of times objects are created or released.

EA Server offers Object Pooling for components deployed to EA server. When this option is turned on for a component, the object instances are pooled before returning to memory.

EA Server/PB settings that effect Pooling
Our Software uses object pooling option available in EA Server. This option is external to the PB language and is part of EA Server administration. The settings are available in component Properties -> Instances tab in Jaguar Manager.

Below setting enables Pooling for a component in EA Server, if checked.

component_properties1

Fig 1: This defines if pooling needs to be used for a particular object.

Below settings for the component in EA Server define how and when Pooling of the object can take place. As mentioned in the note, an object instance is kept in the pool only if it doesn’t exceed maximum setting. In this case, the pool will have at least 3 instances at any time. By adjusting these settings we can optimize the memory handling for the object. Too low setting for the minimum will cause more frequent garbage collection and too high will keep too many instances in the pool, thus wasting memory.

On the other hand, “Maximum Pooled Instances” setting effects how many can be kept in the pool. In a scenario where this object is constantly requested, increasing maximum setting will help. Again, this also means too many will be sitting in the pool during idle times.

component_properties2
Fig 2:
These settings define how instances of the object are pooled.

PB settings for Pooling
The below PB settings only decide if the releasing of object reference from PB side is automatic or manual. These settings are set at the component level in EAServer Component Generator (Project Painter).

The actual pooling is effected by the settings on the EA Server side, as mentioned above.

 

component_properties3

Fig 3: This shows the settings on the PB side.

 

EA Server object instance life cycle

Below image is a capture of a visio diagram (attached) that attempts to show how pooling plays a role when objects are created from Powerbuilder code. As mentioned, Auto demarcation affects how the object references are released (automatic or manual) on the PB side.

When pooling is enabled for the object on the EA Server side (see Fig1), once the references are released the object instance is typically qualified for garbage collection.

If pooling is enabled, the object instance is then returned to Object Pool in EA Server, if the other conditions are met (see Fig 2).

latax_easerver_object_pooling

Fig 3: Object Life Cycle during a typical method call

References:

http://en.wikipedia.org/wiki/Memory_pool
http://en.wikipedia.org/wiki/Object_pool_pattern
http://www.javaworld.com/jw-06-1998/jw-06-object-pool.html
http://www.codeproject.com/KB/cpp/MemoryPoolIntroduction.aspx
http://mikebarlotta.sys-con.com/node/42163/

http://manuals.sybase.com/onlinebooks/group-eag/eag0500e/easpg/@Generic__BookTextView/1308;nh=1;pt=1260?DwebQuery=pooling&DwebSearchAll=1
http://manuals.sybase.com/onlinebooks/group-pb/pbg0900e/apptech/@Generic__BookTextView/31253;pt=28986/*

EA Server


I’ve been posting about Powerbuilder a lot lately. The PB application, I work with currently is actually an n-tier application written in PB, Java and JSP. The application is built around a middle tier from Sybase called Enterprise Application (EA) Server. It’s also called Jaguar (which is actually a part of the EA Server). A quick search for EA Server in google brings up Electronics Arts page, a gaming site. Search on Jaguar brings up all kinds of other things. So, there is not a lot of help on EA Server, though Sybase’s own site has a wealth of information on the product. In my current project, we rely on EA Server for all our business rules and multi-tier application support. I am learning about the product in an effort to improve our architecture and thus our application performance. I will my share my experiences here, so it can benefit others trying to learn or use the product.

EA Server is an Application Server like Oracle Weblogic, IBM Websphere, JBoss etc. It is a Java container like all others mentioned. EA Server is a full blown Java server, so it supports Servlet, JSP, EJB and JMS. Apart from that, it has a speciality of being able to run PB objects as well. With support for CORBA (IIOP) and COM (on windows machines) components, it enables PB developers to develop application modules in PB, Java, C++ that can talk to each other through CORBA. For e.g., we have a site built using JSP pages that “talk” to PB objects. Recently, I developed a wrapper in Java for PB classes, so our Coldfusion applications can use PB objects as well. With this setup, we are able to implement an n-tier application in various languages.

While researching the issues and figuring out new methods to improve our Server performance, I realized how powerful the server is. I currently work with EAS 5.5. The latest version is 6.4. In 6.x, Sybase rearchitected the product completely to be more Java centric. To be able to do that, they included a Jetty Java container and wrapped each PB object as a J2EE object, so everything runs as Java objects. I haven’t tried this version yet, but it sounds interesting. Unfortunately, from what I heard, Sybase (SAP) is thinking of getting rid of this completely in a few years and re-architect PB support into SAP’s Netweaver server. So, really the knowledge about EA Server may disappear in a few years. (This is exactly what happened to Forte! Is it my luck or what?).

Irrespective of the fate of the EA Server, I believe the techniques learned in this exercise will be useful with other servers as well. I am already, trying our web app in Apache Tomcat which can then connect to our PB objects running in EA Server. I will share these experiences here as well.  So, if you are interested in EA Server or writing n-tier in PB or even how to make PB talk to Java components usingCORBA, please check back in.

Born Again Powerbuilder


I am a born again Powerbuilder (developer)! That’s right I program in Sybase’s Powerbuilder, again!

Like many I also left it sometime in 1999 when it looked like fading. But, Powerbuilder has proved it’s worth and reserved it’s place and pace in the ever growing world of Java, C++ and .Net. It has not only survived the onslaught of new technologies, but I feel it is coming out of hibernation.

To those who don’t have a clue as to what Powerbuilder is, it’s a client server development tool that a small company called Powersoft brought out in the late 80’s. It had it’s hay days in the 90’s during the hysteria in corporate world to migrate out of “legacy” mainframe applications to Client/Server. Few of us, that knew Powerbuilder were the “new kids on the block” and the new order priests. But it all dried down soon after Sybase took over. By then internet programming took over and the rest is history.

Now, Powerbuilder is becoming “legacy” application itself and I know what those Mainframe programmers must have felt when we “Client/Server” programmers arrived. One consolation: Powerbuilder did not die while competition like Visual Basic, Gupta SQL and Oracle CDE slowly disappeared in the corporate scene, either naturally or because of company policies. At least, it has been a recession proof job finder for me.

If anyone tries to search “Powerbuilder” on the net, they may be up against broken links and/or old contents. There hasn’t been any good books written on the subject and while it seems to be dying, you also hear about Sybase bringing out the Powerbuilder ver 12.x and Pocketbuilder etc. They also silently integrated Java into their product line.

I recently took up yet another Powerbuilder job maintaining a PB 10.x application using EA Server 5.5. I intend to share with you my experiences and my love-hate relationship with the product.

Hope you find this useful.