SlideShare ist ein Scribd-Unternehmen logo
1 von 46
Downloaden Sie, um offline zu lesen
MONTREAL JUNE 30, JULY 1ST AND 2ND 2012




Persistent Session Storage
Henceforth referred to as PSS :)

- Ramsey Gurley
Demo
MONTREAL JUNE 30, JULY 1ST AND 2ND 2012




What does this mean?
Robust, scalable, front end apps using component actions.
Advantages of PSS


•   Memory consumption

•   Long sessions

•   Distribution
Memory Consumption


•   Sessions storage handled by EOF

•   Session memory freed after each request

•   Drastically improves stateful performance under load
Long Sessions


•   WOSessionTimeOut=0

•   Bookmarkable component actions
Distribution


•   WOSession’s setDistributionEnabled()

•   Restart instances anytime

•   Improved scaling
How do I enable PSS?
Demo
Steps to enable PSS


•   Add ERPersistentSessionStorage framework

•   Set up the connection dictionary for the model

•   Generate the schema from the model (Enable migrations)
MONTREAL JUNE 30, JULY 1ST AND 2ND 2012




How now brown cow?
Why has no one done this before now?
Serialization Bug
EOGenericRecord

             •   Serialize EO
EO      EC
             •   Serializes EC

             •   Deserialize EO

             •   Deserialize EC

             •   Populate EO
Workaround?


•   Serialize EC first!

•   Fails :(
EOGenericRecord

             •   Serialize EO
EO      EO
             •   Serializes related

             •   Deserialize EO

             •   Deserialize related

             •   Populate EO
What happens?

•   EOCustomObject classDescription

•   EOGenericRecord serializes classDescription

•   Deserialize EOCustomObject sets values

•   Dictionary not created until EOGenericRecord sets
    classDescription

•   NullPointerException
Serialization Bug Fix


•   Re-implement core classes

    •   EOCustomObject

    •   EOGenericRecord
Other WO Serialization Erros


•   WODisplayGroup

•   D2WPage
Serialization


•   Classpath order - ERD2W & ERPSS

•   General rule - Wonder first
PSS Requirements
PSS Requirements


•   Serializable components and classes

•   Serializable session

•   No memory leaks
Serializable Classes
serialVersionUID
    /**
	    * Do I need to update serialVersionUID? See section 5.6 <cite>Type Changes
	    * Affecting Serialization</cite> on page 51 of the <a
	    * href="http://java.sun.com/j2se/1.4/pdf/serial-spec.pdf">Java Object
	    * Serialization Spec</a>
	    */
	   private static final long serialVersionUID = 1L;
Update serialVersionUID?

•   Change class hierarchy

•   Delete fields

    •   Make non-static into static

    •   Make non-transient into transient

    •   Change type of a primitive field
Serializable Session
Serializable Session


•   Serializable instance variables

•   Serializable object store contents
No Memory Leaks
Helpful Tools


•   FindBugs

•   jvisualvm

•   jMeter
Find Serialization Errors
FindBugs
http://findbugs.cs.umd.edu/eclipse/
FindBugs
Serialization Debug Property
sun.io.serialization.extendedDebugInfo=true
Serialization Debug Property
    Caused by: java.io.NotSerializableException: er.extensions.localization.ERXLocalizer
	   - field (class "er.modern.directtoweb.components.ERMDBatchSizeControl", name: "_localizer", ...
	   - object (class "er.modern.directtoweb.components.ERMDBatchSizeControl",...
	   - element of array (index: 5)
	   - array (class "[Ljava.lang.Object;", size: 7)
	   - field (class "com.webobjects.foundation.NSDictionary", name: "objects", type: "class [Ljava.lang.Object;")
	   - custom writeObject data (class "com.webobjects.foundation.NSDictionary")
	   - object (class "com.webobjects.foundation.NSMutableDictionary", ...
	   - custom writeObject data (class "com.webobjects.appserver.WOComponent")
	   - object (class "er.modern.look.pages.ERMODListPage", ...
	   - field (class "com.webobjects.appserver._private.WOTransactionRecord", name: ...
	   - object (class "com.webobjects.appserver._private.WOTransactionRecord", ...
	   - element of array (index: 1)
	   - array (class "[Ljava.lang.Object;", size: 2)
	   - field (class "com.webobjects.foundation.NSDictionary", name: "objects", type: "class [Ljava.lang.Object;")
	   - custom writeObject data (class "com.webobjects.foundation.NSDictionary")
	   - object (class "com.webobjects.foundation.NSMutableDictionary",
	   - field (class "com.webobjects.appserver.WOSession", name: "_contextRecords", ...
	   - root object (class "wowodc.modernpss.Session", ...
Other Serialization Issues
D2WContext


•   D2WContext is not serializable

•   ERD2WContext is serializable

•   Use ERD2WContext factory
ERD2WContext
•   Does not serialize entire context

    •   frame

    •   task

    •   entity

    •   propertyKey

    •   pageConfiguration

    •   object
ERXEC



•   calls dispose() during writeObject()
Find Memory Leaks
jvisualvm


•   Installed with Java 1.6+

•   Just type ‘jvisualvm’ into Terminal.app to launch

•   View CPU and memory usage
No Memory Leak
Memory Leak
Analyzing Memory


•   Heap Dump

•   Object Query Language (OQL)

    •   http://visualvm.java.net/oqlhelp.html
Load Testing With JMeter
JMeter



•   http://jmeter.apache.org/
Finding a Memory Leak Demo
Q &A

Weitere ähnliche Inhalte

Andere mochten auch

Java8 - Interfaces, evolved
Java8 - Interfaces, evolvedJava8 - Interfaces, evolved
Java8 - Interfaces, evolvedCharles Casadei
 
Javase5generics
Javase5genericsJavase5generics
Javase5genericsimypraz
 
Java Serialization
Java SerializationJava Serialization
Java Serializationjeslie
 
Java - Singleton Pattern
Java - Singleton PatternJava - Singleton Pattern
Java - Singleton PatternCharles Casadei
 
Java Serialization
Java SerializationJava Serialization
Java Serializationimypraz
 

Andere mochten auch (6)

Java8 - Interfaces, evolved
Java8 - Interfaces, evolvedJava8 - Interfaces, evolved
Java8 - Interfaces, evolved
 
Javase5generics
Javase5genericsJavase5generics
Javase5generics
 
Unexpected achievements 2013
Unexpected achievements 2013Unexpected achievements 2013
Unexpected achievements 2013
 
Java Serialization
Java SerializationJava Serialization
Java Serialization
 
Java - Singleton Pattern
Java - Singleton PatternJava - Singleton Pattern
Java - Singleton Pattern
 
Java Serialization
Java SerializationJava Serialization
Java Serialization
 

Ähnlich wie Persistent Session Storage

Building Concurrent WebObjects applications with Scala
Building Concurrent WebObjects applications with ScalaBuilding Concurrent WebObjects applications with Scala
Building Concurrent WebObjects applications with ScalaWO Community
 
WebObjects Optimization
WebObjects OptimizationWebObjects Optimization
WebObjects OptimizationWO Community
 
Scotas - Oracle Open World Sao Pablo
Scotas - Oracle Open World Sao PabloScotas - Oracle Open World Sao Pablo
Scotas - Oracle Open World Sao PabloJulian Arocena
 
Easy Java Integration Testing with Testcontainers​
Easy Java Integration Testing with Testcontainers​Easy Java Integration Testing with Testcontainers​
Easy Java Integration Testing with Testcontainers​Payara
 
DanNotes 2013: OpenNTF Domino API
DanNotes 2013: OpenNTF Domino APIDanNotes 2013: OpenNTF Domino API
DanNotes 2013: OpenNTF Domino APIPaul Withers
 
Hacking Adobe Experience Manager sites
Hacking Adobe Experience Manager sitesHacking Adobe Experience Manager sites
Hacking Adobe Experience Manager sitesMikhail Egorov
 
Доклад Михаила Егорова на PHDays
Доклад Михаила Егорова на PHDaysДоклад Михаила Егорова на PHDays
Доклад Михаила Егорова на PHDaysru_Parallels
 
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.WO Community
 
How to train the jdt dragon
How to train the jdt dragonHow to train the jdt dragon
How to train the jdt dragonAyushman Jain
 
Java EE 6, Eclipse @ EclipseCon
Java EE 6, Eclipse @ EclipseConJava EE 6, Eclipse @ EclipseCon
Java EE 6, Eclipse @ EclipseConLudovic Champenois
 
Custom EOAdaptors and ERSolr
Custom EOAdaptors and ERSolrCustom EOAdaptors and ERSolr
Custom EOAdaptors and ERSolrWO Community
 
GOTO Night with Charles Nutter Slides
GOTO Night with Charles Nutter SlidesGOTO Night with Charles Nutter Slides
GOTO Night with Charles Nutter SlidesAlexandra Masterson
 
Overview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUGOverview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUGMarakana Inc.
 
Ceylon module repositories by Aleš Justin
Ceylon module repositories by Aleš JustinCeylon module repositories by Aleš Justin
Ceylon module repositories by Aleš JustinUnFroMage
 
Concurrency and Thread-Safe Data Processing in Background Tasks
Concurrency and Thread-Safe Data Processing in Background TasksConcurrency and Thread-Safe Data Processing in Background Tasks
Concurrency and Thread-Safe Data Processing in Background TasksWO Community
 

Ähnlich wie Persistent Session Storage (20)

Building Concurrent WebObjects applications with Scala
Building Concurrent WebObjects applications with ScalaBuilding Concurrent WebObjects applications with Scala
Building Concurrent WebObjects applications with Scala
 
WebObjects Optimization
WebObjects OptimizationWebObjects Optimization
WebObjects Optimization
 
Scotas - Oracle Open World Sao Pablo
Scotas - Oracle Open World Sao PabloScotas - Oracle Open World Sao Pablo
Scotas - Oracle Open World Sao Pablo
 
Easy Java Integration Testing with Testcontainers​
Easy Java Integration Testing with Testcontainers​Easy Java Integration Testing with Testcontainers​
Easy Java Integration Testing with Testcontainers​
 
Presentation on java
Presentation  on  javaPresentation  on  java
Presentation on java
 
DanNotes 2013: OpenNTF Domino API
DanNotes 2013: OpenNTF Domino APIDanNotes 2013: OpenNTF Domino API
DanNotes 2013: OpenNTF Domino API
 
Hacking Adobe Experience Manager sites
Hacking Adobe Experience Manager sitesHacking Adobe Experience Manager sites
Hacking Adobe Experience Manager sites
 
Доклад Михаила Егорова на PHDays
Доклад Михаила Егорова на PHDaysДоклад Михаила Егорова на PHDays
Доклад Михаила Егорова на PHDays
 
Eclipse e4
Eclipse e4Eclipse e4
Eclipse e4
 
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
 
How to train the jdt dragon
How to train the jdt dragonHow to train the jdt dragon
How to train the jdt dragon
 
Java EE 6, Eclipse @ EclipseCon
Java EE 6, Eclipse @ EclipseConJava EE 6, Eclipse @ EclipseCon
Java EE 6, Eclipse @ EclipseCon
 
Custom EOAdaptors and ERSolr
Custom EOAdaptors and ERSolrCustom EOAdaptors and ERSolr
Custom EOAdaptors and ERSolr
 
GOTO Night with Charles Nutter Slides
GOTO Night with Charles Nutter SlidesGOTO Night with Charles Nutter Slides
GOTO Night with Charles Nutter Slides
 
JS Essence
JS EssenceJS Essence
JS Essence
 
JSF2
JSF2JSF2
JSF2
 
ngCore
ngCorengCore
ngCore
 
Overview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUGOverview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUG
 
Ceylon module repositories by Aleš Justin
Ceylon module repositories by Aleš JustinCeylon module repositories by Aleš Justin
Ceylon module repositories by Aleš Justin
 
Concurrency and Thread-Safe Data Processing in Background Tasks
Concurrency and Thread-Safe Data Processing in Background TasksConcurrency and Thread-Safe Data Processing in Background Tasks
Concurrency and Thread-Safe Data Processing in Background Tasks
 

Mehr von WO Community

In memory OLAP engine
In memory OLAP engineIn memory OLAP engine
In memory OLAP engineWO Community
 
Using Nagios to monitor your WO systems
Using Nagios to monitor your WO systemsUsing Nagios to monitor your WO systems
Using Nagios to monitor your WO systemsWO Community
 
Build and deployment
Build and deploymentBuild and deployment
Build and deploymentWO Community
 
Reenabling SOAP using ERJaxWS
Reenabling SOAP using ERJaxWSReenabling SOAP using ERJaxWS
Reenabling SOAP using ERJaxWSWO Community
 
Chaining the Beast - Testing Wonder Applications in the Real World
Chaining the Beast - Testing Wonder Applications in the Real WorldChaining the Beast - Testing Wonder Applications in the Real World
Chaining the Beast - Testing Wonder Applications in the Real WorldWO Community
 
D2W Stateful Controllers
D2W Stateful ControllersD2W Stateful Controllers
D2W Stateful ControllersWO Community
 
Deploying WO on Windows
Deploying WO on WindowsDeploying WO on Windows
Deploying WO on WindowsWO Community
 
Unit Testing with WOUnit
Unit Testing with WOUnitUnit Testing with WOUnit
Unit Testing with WOUnitWO Community
 
Apache Cayenne for WO Devs
Apache Cayenne for WO DevsApache Cayenne for WO Devs
Apache Cayenne for WO DevsWO Community
 
Advanced Apache Cayenne
Advanced Apache CayenneAdvanced Apache Cayenne
Advanced Apache CayenneWO Community
 
Migrating existing Projects to Wonder
Migrating existing Projects to WonderMigrating existing Projects to Wonder
Migrating existing Projects to WonderWO Community
 
iOS for ERREST - alternative version
iOS for ERREST - alternative versioniOS for ERREST - alternative version
iOS for ERREST - alternative versionWO Community
 
"Framework Principal" pattern
"Framework Principal" pattern"Framework Principal" pattern
"Framework Principal" patternWO Community
 
Filtering data with D2W
Filtering data with D2W Filtering data with D2W
Filtering data with D2W WO Community
 
Localizing your apps for multibyte languages
Localizing your apps for multibyte languagesLocalizing your apps for multibyte languages
Localizing your apps for multibyte languagesWO Community
 

Mehr von WO Community (20)

KAAccessControl
KAAccessControlKAAccessControl
KAAccessControl
 
In memory OLAP engine
In memory OLAP engineIn memory OLAP engine
In memory OLAP engine
 
Using Nagios to monitor your WO systems
Using Nagios to monitor your WO systemsUsing Nagios to monitor your WO systems
Using Nagios to monitor your WO systems
 
Build and deployment
Build and deploymentBuild and deployment
Build and deployment
 
High availability
High availabilityHigh availability
High availability
 
Reenabling SOAP using ERJaxWS
Reenabling SOAP using ERJaxWSReenabling SOAP using ERJaxWS
Reenabling SOAP using ERJaxWS
 
Chaining the Beast - Testing Wonder Applications in the Real World
Chaining the Beast - Testing Wonder Applications in the Real WorldChaining the Beast - Testing Wonder Applications in the Real World
Chaining the Beast - Testing Wonder Applications in the Real World
 
D2W Stateful Controllers
D2W Stateful ControllersD2W Stateful Controllers
D2W Stateful Controllers
 
Deploying WO on Windows
Deploying WO on WindowsDeploying WO on Windows
Deploying WO on Windows
 
Unit Testing with WOUnit
Unit Testing with WOUnitUnit Testing with WOUnit
Unit Testing with WOUnit
 
Life outside WO
Life outside WOLife outside WO
Life outside WO
 
Apache Cayenne for WO Devs
Apache Cayenne for WO DevsApache Cayenne for WO Devs
Apache Cayenne for WO Devs
 
Advanced Apache Cayenne
Advanced Apache CayenneAdvanced Apache Cayenne
Advanced Apache Cayenne
 
Migrating existing Projects to Wonder
Migrating existing Projects to WonderMigrating existing Projects to Wonder
Migrating existing Projects to Wonder
 
iOS for ERREST - alternative version
iOS for ERREST - alternative versioniOS for ERREST - alternative version
iOS for ERREST - alternative version
 
iOS for ERREST
iOS for ERRESTiOS for ERREST
iOS for ERREST
 
"Framework Principal" pattern
"Framework Principal" pattern"Framework Principal" pattern
"Framework Principal" pattern
 
Filtering data with D2W
Filtering data with D2W Filtering data with D2W
Filtering data with D2W
 
WOver
WOverWOver
WOver
 
Localizing your apps for multibyte languages
Localizing your apps for multibyte languagesLocalizing your apps for multibyte languages
Localizing your apps for multibyte languages
 

Persistent Session Storage

  • 1. MONTREAL JUNE 30, JULY 1ST AND 2ND 2012 Persistent Session Storage Henceforth referred to as PSS :) - Ramsey Gurley
  • 3. MONTREAL JUNE 30, JULY 1ST AND 2ND 2012 What does this mean? Robust, scalable, front end apps using component actions.
  • 4. Advantages of PSS • Memory consumption • Long sessions • Distribution
  • 5. Memory Consumption • Sessions storage handled by EOF • Session memory freed after each request • Drastically improves stateful performance under load
  • 6. Long Sessions • WOSessionTimeOut=0 • Bookmarkable component actions
  • 7. Distribution • WOSession’s setDistributionEnabled() • Restart instances anytime • Improved scaling
  • 8. How do I enable PSS?
  • 10. Steps to enable PSS • Add ERPersistentSessionStorage framework • Set up the connection dictionary for the model • Generate the schema from the model (Enable migrations)
  • 11. MONTREAL JUNE 30, JULY 1ST AND 2ND 2012 How now brown cow? Why has no one done this before now?
  • 13. EOGenericRecord • Serialize EO EO EC • Serializes EC • Deserialize EO • Deserialize EC • Populate EO
  • 14. Workaround? • Serialize EC first! • Fails :(
  • 15. EOGenericRecord • Serialize EO EO EO • Serializes related • Deserialize EO • Deserialize related • Populate EO
  • 16. What happens? • EOCustomObject classDescription • EOGenericRecord serializes classDescription • Deserialize EOCustomObject sets values • Dictionary not created until EOGenericRecord sets classDescription • NullPointerException
  • 17. Serialization Bug Fix • Re-implement core classes • EOCustomObject • EOGenericRecord
  • 18. Other WO Serialization Erros • WODisplayGroup • D2WPage
  • 19. Serialization • Classpath order - ERD2W & ERPSS • General rule - Wonder first
  • 21. PSS Requirements • Serializable components and classes • Serializable session • No memory leaks
  • 23. serialVersionUID /** * Do I need to update serialVersionUID? See section 5.6 <cite>Type Changes * Affecting Serialization</cite> on page 51 of the <a * href="http://java.sun.com/j2se/1.4/pdf/serial-spec.pdf">Java Object * Serialization Spec</a> */ private static final long serialVersionUID = 1L;
  • 24. Update serialVersionUID? • Change class hierarchy • Delete fields • Make non-static into static • Make non-transient into transient • Change type of a primitive field
  • 26. Serializable Session • Serializable instance variables • Serializable object store contents
  • 28. Helpful Tools • FindBugs • jvisualvm • jMeter
  • 33. Serialization Debug Property Caused by: java.io.NotSerializableException: er.extensions.localization.ERXLocalizer - field (class "er.modern.directtoweb.components.ERMDBatchSizeControl", name: "_localizer", ... - object (class "er.modern.directtoweb.components.ERMDBatchSizeControl",... - element of array (index: 5) - array (class "[Ljava.lang.Object;", size: 7) - field (class "com.webobjects.foundation.NSDictionary", name: "objects", type: "class [Ljava.lang.Object;") - custom writeObject data (class "com.webobjects.foundation.NSDictionary") - object (class "com.webobjects.foundation.NSMutableDictionary", ... - custom writeObject data (class "com.webobjects.appserver.WOComponent") - object (class "er.modern.look.pages.ERMODListPage", ... - field (class "com.webobjects.appserver._private.WOTransactionRecord", name: ... - object (class "com.webobjects.appserver._private.WOTransactionRecord", ... - element of array (index: 1) - array (class "[Ljava.lang.Object;", size: 2) - field (class "com.webobjects.foundation.NSDictionary", name: "objects", type: "class [Ljava.lang.Object;") - custom writeObject data (class "com.webobjects.foundation.NSDictionary") - object (class "com.webobjects.foundation.NSMutableDictionary", - field (class "com.webobjects.appserver.WOSession", name: "_contextRecords", ... - root object (class "wowodc.modernpss.Session", ...
  • 35. D2WContext • D2WContext is not serializable • ERD2WContext is serializable • Use ERD2WContext factory
  • 36. ERD2WContext • Does not serialize entire context • frame • task • entity • propertyKey • pageConfiguration • object
  • 37. ERXEC • calls dispose() during writeObject()
  • 39. jvisualvm • Installed with Java 1.6+ • Just type ‘jvisualvm’ into Terminal.app to launch • View CPU and memory usage
  • 42. Analyzing Memory • Heap Dump • Object Query Language (OQL) • http://visualvm.java.net/oqlhelp.html
  • 44. JMeter • http://jmeter.apache.org/
  • 45. Finding a Memory Leak Demo
  • 46. Q &A