Tuesday, October 18, 2011

Red Samurai Business Contextual Messaging Extension for Oracle WebCenter

We have recorded demo videocast for our WebCenter 11g extension - Business Contextual Messaging. Read more about our extensions for WebCenter - Red Samurai Social Enterprise Extensions for Oracle WebCenter. Videocast explains in detail how this extension works - very similar to Facebook, except pictures we have business data. Business Contextual Messaging extension is designed to simplify business communication within enterprise:
  1. Minimize emails and transfer business communication directly into enterprise system
  2. Enable easier tracking and escalation of communication on business context
  3. Be able to read new messages directed to business user, based on custom security
  4. Check if business user is online/offline
Extension is built using ADF 11g Faces and ADF Task Flows, consuming WebCenter Java API in the background. WebCenter Java API is used to integrate standard WebCenter Activity Stream functionality for Business Contextual Messaging approach.

Demo videocast is recorded in HD, switch to 720p and fullscreen mode on Youtube for better video quality:



Complete set of WebCenter extensions from Red Samurai:


Saturday, October 15, 2011

ADF BC Tuning with Do Connection Pooling and TXN Disconnect Level

For one of my previous posts, Steve Muench was pointing out that there is option to tune data source usage in ADF by setting jbo.doconnectionpooling = true and jbo.txn.disconnect_level = 1. You can find Steve comment here - How To Speed Up Application Undeployment in JDeveloper 11g R2. If your application contains many application modules (let's say 50) and there are lots of concurrent users working at the same time, with default ADF BC settings we would reserve large number of database connections. Reserved connection will be hanging until AM instance will be destroyed. This is not what we want, especially with high number of concurrent users. If we set jbo.doconnectionpooling = true, database connection will be reserved only during HTTP request and then released. Thats not good, because lots of AM passivation/activation will happen. However, with second property - jbo.txn.disconnect_level = 1, ADF BC instead of passivating/activating  to database, will keep AM data in memory during HTTP requests. It will passivate/activate as expected, only if AM instance will be granted to another session (situation when no free AM instances in the pool). Based on chapter 44.2 Setting Pool Configuration Parameters, there is Oracle recommendation:

Leave the jbo.doconnectionpooling configuration parameter set to false for best performance without sacrificing scalability and reliability. Database connection pooling is still achieved through application module pooling. The only exception is when multiple application module pools (and therefore a large number of application module instances) share the same database, making the total available database connections the highest priority.

But few lines below that, there is another recommendation:

However, when minimizing the total overall number of database sessions is a priority, one situation in which it might be appropriate to use database connection pooling is when you have a large number of application module pools all needing to use database connections from the same underlying application user at the database level.

Finally chapter 44.3.2 What You May Need to Know About Database User State and jbo.doconnectionpooling = true says:

Alternatively, you can set jbo.txn.disconnect_level=1 (default is 0) to ensure that all application modules, view objects and row sets remain in memory and stay valid after their corresponding references to JDBC connections are dropped. Upon activation, the framework reexecutes and synchronizes the cursor positions. When used in conjunction with jbo.doconnectionpooling=true, setting jbo.txn.disconnect_level=1 reduces the memory overhead associated with this situation.

Before diving into technical experiment, lets draw some conclusion based on Oracle documentation:

  1. If we don't have large number of concurrent users, and number of opened database connections is not priority - its better to use default ADF BC setting (jbo.doconnectionpooling = false). This will safe some performance, because it will not close/open database connection for each HTTP request
  2. If opened database connections reduction is priority and there is large number of concurrent users, we can turn on database connection pooling and enable virtual memory to keep AM data in between requests (without passivating it to database). This will allow to detach AM instance from DB connection and prevent opened database connection hanging until timeout happens
  3. Please test tuning options thoroughly, before applying - every tuning have its own side effect
I did couple of experiments, to test how these different settings affect application performance. Download sample application with database connection pooling and virtual memory for AM instance enabled - DoConnectionPoolingApp.zip.

Sample application is fairly simple, I'm testing only navigation between different rows. First, let's test with default ADF BC settings, when database connection pooling is disabled:


In average, Next/Previous operation completes in 750 ms:


Database connections are reserved for long time, until AM instance will timeout:


Situation with default settings is quite clear, let's now enable database connection pooling. Also override prepareSession(Session) method in AM, you will see it will be called now for every HTTP request - make sure it doesn't break any custom logic, if any implemented in prepareSession(Session) from your system:


Enable database connection pooling - set Disconnect Application Module Upon Release:


Test Next/Previous actions, when database connection pooling is enabled, scroll through row set - it works significantly slower - 3 seconds in average:


It is much slower, because for every HTTP request, passivation/activation to/from database happens - connection is detached from AM instance (it might be very slow, especially if VO SQL is complex, because it will be re-executed on each HTTP request):


We can see this from connection graph, database connection is reserved for 1 second and then returned back to the pool:


Now let's enable virtual memory for ADF BC and set jbo.txn.disconnect_level = 1 (default is 0):


With virtual memory enabled, we can scroll through row set much faster: 870 ms in average (it adds few ms perhaps because database connection is re-established on each HTTP request):


Big advantage - database connection in most of the cases is reserved for such short time, its even not registered. Only for longer requests, we can spot that database connection is used and then immediately released back - very good:


Let's see now, how this tuning behaves in stress test environment. We set Maximum Pool Size = 1 and Referenced Pool Size = 1, this means there is space only for 1 session - second session will be activated and first always passivated:


From session A, let's filter result set:


Open another session B:


Session A data will not be lost, it will be passivated into database in this case, because there is no space in AM pool:


When session A will be activated, SQL will be re-executed as expected:


This means, even when database connection pooling is ON and virtual memory is ON, passivation/activation mechanism still works - when there is not enough space inside AM pool. Thats good, try to apply jbo.doconnectionpooling = true and jbo.txn.disconnect_level = 1 and test to see positive/negative effect in your project.

Tuesday, October 11, 2011

Oracle Open World 2011 Slides - Texas A&M University System Architecture: Oracle ADF, Oracle WebCenter Portal and Content

Posting slides from Oracle Open World 2011 event. Together with Sreeja Sreekumaran, Technical Lead, TEES, Texas A&M University System, we were presenting production system and explaining technical implementation. We were focusing on:
  • RSS Feeds and WebCenter MDS customization
  • WebCenter Portal Framework Menu
  • Red Samurai Messaging based on WebCenter API


  • Advanced WebCenter Composer
  • UCM Content Presenter
It was exciting session, we completed five live demos, there was no single exception or error. Sreeja was doing production system demo and explaining various functionalities, I was talking about technical tips and tricks.

You can download our session slides - each demo is supported with a link from the blog. It describes in detail presented solution and its implementation, sample application code is available as well.


Stay tuned - soon I will upload a set of video files for this session.

Saturday, October 8, 2011

Red Samurai Social Enterprise Extensions for Oracle WebCenter

Oracle Open World 2011 was super exciting event for Oracle announcements - Larry Ellison announced Oracle Social Network on the Cloud. This is very important for Red Samurai, because we are inline with technology trend - Social Enterprise. Listen our podcast with Oracle - Social Enterprise: Live Podcast at Oracle OpenWorld as I discuss how Red Samurai is helping Oracle WebCenter customers experience the social enterprise with extensions Red Samurai has developed for Oracle WebCenter social business tailored use cases.

We are focusing on five main technology areas and providing Oracle WebCenter extensions for:
  • Business Contextual Messaging (enterprise Facebook approach)
  • Lightweight User Presence (no external communication server required)
  • SAP/Microsoft Integration
  • Documents (extensions for Oracle UCM integration and lightweight document management)
  • Search (simplifying Search across different data sources)


Stay tuned - soon we will release videocast for Red Samurai Business Contextual Messaging extension, implemented on top of Oracle WebCenter Services API.

Sunday, September 25, 2011

How To Speed Up Application Undeployment in JDeveloper 11g R2

There was new patch set released this week for JDeveloper 11g R2, its called (11.1.2.1.0). I had a quick look, there are still few issues left from previos release (11.1.2.0.0), but overall this new update looks better and more stable.

Update: Same applies for JDeveloper 11g R1.

This post describes issue related to long application undeployment time. Reproduced when running on embedded WLS directly from JDev. I had this issue in (11.1.2.0.0), same reproduced with (11.1.2.1.0).

Sample app is fairly basic, it contains one ADF BC AM, read-only VO and one JSF page - ADFAppADFBCSimple11R21.zip:


As per documentation chapter 9.3 Configuring Your Application Module Database Connection, 11g R2 differently than 11g R1, automatically assigns JDBC Data Source name for newly created AM - java:comp/env/jdbc/HrDSDS:


This is good, but once we need to restart application, or even stop it from JDev:


It takes in average 2 minutes to undeploy ADF app. It says - resource pool shutting down, ignoring 1 resource still in use by applications:


If we switch to JDBC URL type and provide connection name, as it was by default in 11gR1:


As we can see from the log, when connection is changed to be JDBC URL type, application is undeployed just in 2 seconds:


2 minutes vs. 2 seconds, I guess difference is obvious? :)

Let's dig deeper.

We can remove data source prefix and leave only - jdbc/HrDSDS:


This would need to define data source on WebLogic manually, when we have prefix java:comp/env/ it means JDev will create temporary data source automatically. I have defined jdbc/HrDSDS manually:


Application is undeployed fast as well, same as using JDBC URL - around 2 seconds:


Lesson learned - in 11g R2, until it will be fixed - don't use auto generated prefix name java:comp/env for data sources. Always define data sources manually on WebLogic or use JDBC URL, as it was default in 11g R1.

Wednesday, September 21, 2011

How to Disable WebLogic Administrator from WebCenter 11g PS3/PS4 Portal Applications Management

While testing your WebCenter 11g PS3/PS4 application security, don't forget to check how portal application behaves for WebLogic administrator user. Typically we don't want to grant admin access to portal for the same user who is administering WebLogic server. Let's see how it works.

Download sample application, where admin access is disabled for WebLogic administrator - EnterprisePortalApp_v9.zip.

When we generate new WebCenter 11g PS3/PS4 application, JDeveloper constructs default UI template. This template is applied for portal pages. Because application is deployed on WebLogic server, and weblogic admin user is one of the users available in security provider - obviously we can login into our application as weblogic user and authentication will be completed successfully:


What about authorization? It seems like by default WebLogic administrator is granted portal admin access as well - Administration link is visible:


It depends on requirements, but in most of the cases we don't want to grant portal admin access to WebLogic administrator. How to disable it?

First place to look - generated UI template. As we can see, showAdmin template attribute by default is enabled to all authenticated users. There is no much logic here, why all authenticated users should see portal Administration link:


We can fix it, by changing showAdmin value to check against Administrator role from ADF Security. Only portal administrators will be able to see Administration link:


We test again, still get same result - WebLogic administrator is able to access Administration link:


Seems like ADF Security role - Administrator is mapped with admin group from WebLogic. We can double check ADF Security configuration - Administrator role is mapped with our custom PortalManager group:


In turn, PortalManager group is assigned for redsam and scott users only, there is no WebLogic admin here:


Ah, here is a trick. Its not visible through wizard and is hidden, you should open Source Code view for ADF Security definition. Only in Source Code view we can see, that ADF Security role "Administrator" is mapped with WebLogic admin group called - "Administrators". We can remove this mapping:


WebLogic administrator will not be able anymore to perform portal application administration - link for Administration resources becomes disabled as well:


Try to login with real portal administrator - redsam user:


Redsam user is granted with ADF Security role - Administrator, access to administration resources is granted:


Friday, September 16, 2011

Integrating UCM Wiki Content Presenter into WebCenter 11g PS3/PS4

WebCenter 11g PS3/PS4 is able to store and retrieve Wiki content directly to and from Oracle UCM Content Server. Thats really good improvement comparing with early WebCenter releases, because there is no need to run separate server just to maintain static Wiki content. However, there are few tips and tricks to know, when integrating and making it work together with WebCenter Portal Framework application. This post will explain how to publish static Wiki content inside WebCenter Portal Framework application with the help of WebCenter Content Presenter ADF Task Flow.

Sample application defines connection to UCM server, you should change these details according to your infrastructure:


Download sample application for this post - EnterprisePortalApp_v8.zip.

Menu is implemented using WebCenter Portal Framework menu model. Wiki content will be retrieved and displayed in the menu using Content Query - Static Content:


In WebCenter PS3/PS4, we can construct menu from list of documents dynamically, based on UCM query. Content Query retrieves Wiki documents of type text/html, by specified Tag - populated list will be converted into menu automatically (make sure Insert Folder Contents option is set):


You may wonder, what is this Tag, which we are using to construct menu list. Tag is defined directly inside UCM, for example if we have documents stored in UCM:


Each of the documents/folders can be assigned with specific Tag, we can use this tag from WebCenter menu model Content Query:


Here is example of menu list populated from Content Query, Wiki document is loaded based on menu selection. All such menu links, generated based on Content Query, are rendering Wiki content directly inside Content Presenter:


We can edit Wiki document, because content is loaded inside Content Presenter automatically. Let's specify a link to another Wiki document available in UCM:


Wiki document is updated inside Content Presenter, using Rich Text editor:


Let's see what will happen, when we click on newly added link to another Wiki document:


When link to another Wiki document is clicked, WebCenter is loading Document Viewer task flow and opens referenced Wiki document:


Its not what we want, there is no need to open Document Viewer, we want to open Wiki document as static HTML page. Even more, when Document Viewer is opened from Wiki link, it destroys WebCenter menu model - portal application becomes broken (even Logout doesn't work):


But don't worry ! There is option to force Wiki links to behave as simple links and load static content - 31.3.5 Displaying Wiki Page Links Within Content Presenter. We need to update adf-config.xml file with Wiki resource handler:


Let's try to click on Wiki link again:


It works now ! Referenced Wiki document was loaded, even menu selection was updated automatically - thats what we need: