Wednesday Jul 31, 2013

JMS JDBC Store Performance Using Multiple Connections

This article is a bit different than the normal data source articles I have been writing because it's focused on an application use of WebLogic Server (WLS) data sources, although the application is still part of WLS.  Java Messaging Service (JMS) supports the use of either a file store or a JDBC store to store JMS persistent messages (the JDBC store can also be used for Transaction Log information, diagnostics, etc.).  The file store is easier to configure,generates no network traffic, and is generally faster.  However, the JDBC store is popular because most customers have invested in High Availability (HA) solutions, like RAC, Data Guard or Golden Gate,  for their database so using a JDBC store on the database makes HA and migration much easier (for the file store, the disk must be shared or migrated). Some work has been done in recent releases to improve the JDBC store performance and take advantage of RAC clusters.

It's obvious from the JDBC store configuration that JMS uses just a single table in the database.  JMS use of this table is sort of like a queue so there are hot spots at the beginning and end of the table as messages are added and consumed - that might get fixed in WLS in the future but it is a consideration for the current store performance.  JMS since the beginning has been single threaded on a single database connection.  Starting in WLS 10.3.6 (see this link), the store can run with multiple worker threads each with its own connection by setting Worker Count on the JDBC Persistent Store page in the console.  There are no documented restrictions or recommendations about how to set this value  Should we set it to the maximum allowed of 1000 so we get a lot of work done?  Not quite ...

Since we have contention between the connections, using too many connections is not good.  To begin with, there is overhead in managing the work among the threads so if JMS is lightly loaded, it's worse to use multiple connections.  When you have a high load, we found that for one configuration, 8 threads gave the best performance but 4 was almost as good at half the resources using the Oracle Thin driver on an Oracle database (more about database vendors below).  Optimization for queues with multiple connections is  a big win with some gains as high as 200%.  Handling a topic is another ... well, topic.  It's complicated by the fact that a message can go to a single or multiple topics and we want to aggregate acknowledgements to reduce contention and improve performance.  Topic testing saw more modest gains of  around 20%, depending on the test.

How about different data source types? It turns out that when using a RAC cluster and updates are scattered across multiple instances, there is too much overhead in locking and cache fusion across the RAC instances.  That makes it important that all of the reserved connections are on a single RAC instance.   For a generic data source, there is nothing to worry about - you have just one node.  In the case of multi data source (MDS), you can get all connections on a single instance by using the AlgorithmType set to "Failover" (see this link ).   All connections will be reserved on the first configured generic data source within the MDS until a failure occurs, then the failed data source will be marked as suspended and all connections will come from the next generic data source in the MDS.  You don't want to use AlgorithmType set to "Load-Balancing".  In the case of Active GridLink (AGL), it's actually difficult to get connection affinity to a single node and without it, performance can seriously degrade.  Some benchmarks saw performance loss of 50% when using multiple connections on different instances.  For WLS 10.3.6 and 12.1.1, it is not recommended to use AGL with multiple connections.  In WLS 12.1.2, this was fixed so that JMS will reserve all connections on the same instance.  If there is a failure, all of the reserved connections need to be closed, a new connection is reserved using Connection Runtime Load Balancing (RCLB), hopefully on a lightly loaded instance), and then the rest of the connections are reserved on the same instance.  In one benchmark, performance improved by 200% when using multiple connections on the same instance.

How about different database vendor types?  Your performance will vary based on the application and the database.  The discussion above regarding RAC cluster performance is interesting and may have implications for any application that you are moving to a cluster.  Another thing that is specific to the Oracle database is indexing the table for efficient access by multiple connections.  In this case, it is recommended to use a reverse key index for the primary key.  The bytes in the key are reversed such that keys that normally would be grouped because the left-most bytes are the same are now distributed more evenly (imagine using a B-tree to store a bunch of sequential numbers with left padding with 0's, for example). 

Bottom line: this feature may give you a big performance boost but you might want to try it with your application, database, hardware, and vary the worker count.




Tuesday Jul 30, 2013

Now available installers for Oracle Enterprise Pack for Eclipse 12c and SmartUpgrade 12c

Now available for download  new installers for  Oracle Enterprise Pack for Eclipse 12c and WebLogicServer SmartUpgrade 12c from the Oracle Technology Network for free development and evaluation purposes.  Licensed customers should download the software from the Oracle Software Delivery Cloud site, which offers different licensing terms.

Oracle Enterprise Pack for Eclipse (OEPE) 12.1.2 provides exciting new features for enhancing ease of integration with Oracle Coherence 12.1.2 and Oracle WebLogic Server 12.1.2.

To find what is new in Oracle Oracle Enterprise Pack for Eclipse (OEPE) 12.1.2 read What is New in OEPE 12c, for installation documentation read Oracle Enterprise Pack for Eclipse Installation Guide.

WebLogic Server SmartUpgrade tool  ensures a highly reliable upgrade process of applications from OC4J  to WebLogic Server 12c.

Find SmartUpgrade documentation here: Oracle WebLogic Server SmartUpgrade Documentation.

Don’t forget to register for the WebLogic Server 12.1.2 Online Launch Event on July 31st.


Monday Jul 29, 2013

New Whitepaper – Cloud Performance, Elasticity and Multitenancy with Oracle WebLogic Server 12c and Oracle Database 12c

One of the exciting focus areas of Oracle WebLogic 12c release 12.1.2 is the deep integration with the recently available Oracle Database 12c.

To hear live about these key integration features, please join our launch event on July 31st

One of the advantages of having the world’s most popular Database and the #1 Application Server under one roof, is the simple rule of 1+1=3, and what do I mean by that?

With our Engineering teams on the Database and Middleware side working hand in hand, Oracle WebLogic Server 11g introduced Active GridLink for Real Application Clusters (RAC). In conjunction with Oracle Database, this powerful software technology simplifies management, increases availability, and ensures fast connection failover, with runtime connection, load balancing and affinity capabilities. Deltek is one of the early adopters of these capabilities. Watch their video

With the release of WebLogic Server 12c (12.1.2), tight integration between Oracle WebLogic Server 12c (12.1.2) and Oracle Database 12c enhances these capabilities with improved availability, better resource sharing, inherent scalability, ease of configuration and automated management facilities in a global cloud environment.


It’s worth noting that Oracle WebLogic Server is the only application server with this degree of integration with Oracle Database 12c.

This white paper, authored by Monica Riccelli and Frances Zhao from the CAF Product Management team, explains how these unique database, clustering, and application server technologies work together to enable higher availability, scalability and performance for your business. It starts by introducing Oracle Active GridLink for RAC with attention to ease of configuration, manageability, and performance. Then describes the impact of Oracle WebLogic server on several leading features of Oracle Database12c such as Multitenant Databases (Pluggable Database), Database Resident Connection Pool, Application Continuity, and Global Data Services.

Please download the whitepaper and let us know your feedback!

You can read more on this topic in these blogs by Steve Felts:

Part 1 - 12c Database and WLS – Overview

Part 2 - 12c Database and WLS - Application continuity


Thursday Jul 25, 2013

CERN Excited about WebLogic 12c release 12.1.2

CERN is world-renowned for their scientific research, operating the world’s largest and most complex scientific instruments to study the basic constituents of matter - the fundamental particles. I bet many of our readers know that! But what you may not have known is that CERN utilizes WebLogic Server as its strategic platform for all developed software, which means support for Administration, Engineering and the Accelerator Center. At the recent WebLogic Customer Advisory Board, we had the pleasure of having with us Artur Wiecek of CERN's Infrastructure IT Department. Artur and other customers had a chance to hear about the new features of WebLogic 12c, release 12.1.2, and we pulled him aside to give you his thoughts on the ones he’s looking to take advantage at at CERN. Watch the video

To learn more about WebLogic 12c release 12.1.2, please join our launch event on July 31st

Wednesday Jul 24, 2013

New Node Manager Configuration Model

Join the Online Launch Event for WLS 12.1.2 on July 31st.

 In WebLogic Server 12.1.2, we have a great new option for configuring and running the Node Manager: by default, Node Manager is now configured with the domain.

We listened!

In recent months, we’ve heard that customers typically manage Node Manager instances with their domains. That is, they install, upgrade, and run Node Manager instances along with the domains where they host their applications. Also, in most cases, it is the same users who manage Node Manager instances along with related domains. The configuration model for Node Manager in previous releases – sharing Node Manager instances across domains – can be more complicated because different groups in the organization upgrade, patch, and have downtime on different schedules.

We listened, and now the default configuration for Node Manager is a Node Manager instance per domain on each of your Managed Server hosts. 

Per-Domain Node Manager Diagram

With this new configuration option, you can now:

  • Align Node Manager lifecycle management with the domains that it manages and monitors
  • Simplify Node Manager configuration through Configuration Wizard/WLST offline and Pack/Unpack commands
  • Maintain your WebLogic installation directory as a read-only directory (Node Manager configuration is now stored with the domain.)

Configuration Wizard Changes

When you create a domain using either WLST or the Configuration Wizard, Node Manager is configured for use with that domain. When I say “configured for that domain,” I mean that:

  • There is a <domain>/nodemanager folder that includes the Node Manager configuration files (nodemanager.domains, nodemanager.properties)
  • There is a startNodeManager script in the <domain>/bin directory
  • In the <domain>/security folder, there is a domain-specific and host-specific DemoIdentity.jks keystore used by the Node Manager for OOTB evaluation and demonstrations

In other words – everything you need to run the Node Manager for the domain is set up for you and is encapsulated in the domain! 

Extending Your Domain with Pack/Unpack

We’ve also made it easier to set up Node Manager for the Managed Servers in your domain:

  • When you use the “pack” command with the “-managed=true” option, the configuration framework includes changes to the nodemanager.properties file in the template file.
  • When you use the “unpack” command on the remote host where you want to run your Managed Servers, the configuration framework sets up the domain, regenerates the nodemanager.properties file, generates a nodemanager.domains file (no need to run nmEnroll!), generates a DemoIdentity.jks keystore, and generates a startNodeManager script.

Out of the gate, you are ready to go with a per-domain Node Manager configuration for each host where you will run your Managed Servers.

Give it a try! 

More Information

Don’t forget to register for the WebLogic Server 12.1.2 Online Launch Event on July 31st.

You can also see the following links:



Monday Jul 22, 2013

Part 2 - 12c Database and WLS - Application continuity

I introduced WLS support for 12c database in this blog link and described one of the prerequisites for Application Continuity (AC) at this blog link.

When an error occurs on a connection, it would be nice to be able to keep processing on another connection - that's what AC does.  When on a single node database, getting another connection means that the database and network are still available, e.g., maybe just a network glitch.  However, in the case of a Real Application Cluster (RAC), chances are good that even if you lost a connection on one instance you can get a connection on another instance for the same database.  For this feature to work correctly, it's necessary to ensure that all of the work that you did on the connection before the error is replayed on the new connection - that's why AC is also called replay. To replay the operations, it's necessary to keep a list of the operations that have been done on the connection so they can be done again.  Of course, when you replay the operations, data might have changed since the last time so it's necessary to keep track of the results to make sure that they match.  So AC may fail if replaying the operations fail.

You can read the WLS documentation, an AC white paper, and the Database documentation to get the details. This article gives an overview of this feature (and a few tidbits that the documentation doesn't cover).

To use this feature, you need to use both the 12c driver and a 12c database.  Note that if you use an 11.2.0.3 driver and/or database, it might appear to work but replay will only happen for read-only transactions (the 11g mode is not supported but we don't have a mechanism to prevent this).

You need to configure a database service to run with AC.  To do that, you need to set the new 12c service attributes FAILOVER_TYPE=TRANSACTION and COMMIT_OUTCOME=true on the server side.

There's not much to turning on AC in WLS - you just use the replay driver "oracle.jdbc.replay.OracleDataSourceImpl" instead of "oracle.jdbc.OracleDriver"  when configuring the data source.  There's no programming in the application needed to use it.  Internal to WLS, when you get a connection we call the API to start collecting the operations and when you close a connection we call the API to clear the operation history.

WLS introduced a labeling callback for applications that use the connection labeling feature.  If this callback is registered, it will be called when a new connection is being initialized before replay.  Even if you aren't using labeling, you might still want to be called and there is a new connection initialization callback that is for replay (labeling callback trumps initialization callback if both exist).

It sounds easy and perfect - what's the catch?   I've already mentioned that you need to get rid of references to concrete classes and use the new Oracle interfaces.  For some applications that might be some significant work.  I've mentioned that if replaying the operations fails or is inconsistent, AC fails.  There are a few other operations that turn off AC - see the documentation for details. One of the big ones is that you can't use replay with XA transactions (at least for now).   Selecting from V$instance or sys_context  or other test traces for test instrumentation needs to be in callouts as the values change when replayed.  If you use sysdate or systimestamp, you need to grant keep date time to your user.

We are also tracking two defects - AC doesn't work with Oracle proxy authentication and it doesn't work with the new DRCP feature. 

There's another more complex topic to consider (not currently in the current WLS documentation).  By default, when a local transaction is completed on the connection, replay ends.  You can keep working on the connection but failure from that point on will return an error to the application. This default is based on the service attribute SESSION_STATE_CONSISTENCY with a value of DYNAMIC.  You can set the value to STATIC if your application does not modify non-transactional session state (NTSS) in the transaction.  I'm not sure how many applications fall into this trap but the safe thing is to default to dynamic.  I'll include such a code fragment below.  A related common problem that people run into is forgetting to disable autocommit, which defaults to true, and the first (implicit) commit turns off replay if SESSION_STATE_CONSISTENCY is set to DYNAMIC.

It's important to know how to turn on debugging so that if a particular sequence doesn't replay, you can understand why.  You simply need to run with the debug driver (ojdbc6_g.jar or ojdbc7_g.jar) and run with -Dweblogic.debug.DebugJDBCReplay (or turn this debug category on in the configuration).

AC won't replay everything and you still need to have some application logic to deal with the failures or return them to the end user.  Also, there's some overhead in time and memory to keep the replay data.  Still, it seems like a great feature for a lot of applications where you don't need to change anything but the driver name and you can avoid showing an error to the end user or simplify some recovery logic.

P.S. Confused about NTSS? So was I.  Examples of non-transactional session state that can change at run-time are ALTER SESSION, PL/SQL global variables, SYS_CONTEXT, and temporary table contents.  Here's an example of a PL/SQL global variable.  Imagine a package with the following body:

 current_order number := null;
 current_line number;
 procedure new_order (customer_id number) is
  current_order := order_seq.nextval;
  insert into orders values (current_order, customer_id);
  current_line := 0;
 end new_order;
 procedure new_line (product_id number, count number) is
  current_line := current_line + 1;
  insert into order_lines values (current_order, current_line,product_id, count);
 end new_line;
end order;

and a psuedo-code sequence in WLS like this:
getConnection()
exec "begin order.new_order(:my_customer_id); end;"
commit;
exec "begin order.new_line(:my_product_id, :my_count); end;"
<DB server failure and failover>
commit;

In this scenario, we won't replay the first transaction, because it's already committed and we'd end up with two orders in the database. But if we don't replay it, we lose the order_id, so the new_line call won't work. So we have to disable replay after the commit.  If you can guarantee that no such scenario exists, you can mark the service session-state as static.



Wednesday Jul 17, 2013

WebLogic Active GridLink - An Oracle and NEC Joint White Paper

Oracle and NEC have been jointly invested on verifying and testing the Active GridLink for RAC solution implemented within Oracle WebLogic Server which gives the rich functionality for Oracle Database Real Application Clusters integration.

To learn about additional enhancements for Oracle WebLogic - Oracle Database integration, please join the Online Launch Event on July 31st.

In this published white paper, we started with a brief introduction to Oracle RAC and an overview of the Oracle RAC features supported in Oracle WebLogic Server 12c. We then focused on details of the effort that have been jointly done with Oracle and NEC with all the detailed testing scenarios and testing results, along with the analysis. The background and overview of NEC’s test of Active GridLink for RAC will be covered in details. The technical details about Runtime Connection Load Balancing, Web Session Affinity, Fast Connection Failover, and how to remove and add the additional RAC node with zero-downtime will be discussed with different use cases.

Check out this Japanese version paper:

http://www.nec.co.jp/middle/oracle/files/gc_wp-gridlink-gridcenter-nec.pdf

English version is coming soon, please check back later!

Gemalto is excited about new Mobile Capabilities in WebLogic 12c release 12.1.2

Gemalto is the leader in making digital interactions secure and easy. It enables its clients to offer trusted and convenient digital services to billions of individuals.

People worldwide increasingly want the freedom to communicate, travel, shop, bank, entertain and work – anytime, anywhere – in ways that are convenient, enjoyable and secure.

Gemalto delivers on their expanding needs for personal mobile services, identity protection, payment security, authenticated online services, cloud computing access, modern transportation, M2M communication, eHealthcare and eGovernment services.

Gemalto’s telecommunication business unit is using multiple versions of WebLogic: 10.3.1, 10.3.2, and 10.3.4. They use WebLogic for their web-based applications, business logic, JMS, and web services. High availability is a significant requirement for Gemalto as they have strict SLA contracts with their customers demanding up to five nines availability during production. So clustering is very important. They are also excited about the new mobile capabilities in WebLogic 12c release 12.1.2. See the short video to hear their story and join the Cloud Application Foundation 12c launch event to learn more about mobile capabilities in WebLogic 12.1.2

Tuesday Jul 16, 2013

Oracle WebLogic Server 12c, Release 12.1.2: And now the Whitepaper

As you read in Will Lyon’s blog from last week, the brand new Oracle WebLogic Server 12.1.2 was made available for download on July 11th!  With this new release customers are able to deliver next generation applications, such as mobile applications, on a mission-critical cloud platform. A big investment went into simplifying operations with native cloud management and finally for the developer audience, the new release offers a modern development platform and integrated tools to increase productivity and accelerate time to market.

The Oracle WebLogic Server 12c, Release 12.1.2 whitepaper contains details of the investment motivations, the focus areas, and use cases. It goes deep into areas like WebLogic Server dynamic clusters for cloud elasticity, existing integration with Oracle RAC and how this release drives even deeper integration with Oracle Database 12c in the areas of Oracle Multi-Tenant, virtualized connection pooling, application continuity, and Global Data Services. The whitepaper discusses features that provide native cloud management with elastic JMS for flexible cloud scaling and the convergence of Oracle WebLogic Server and Oracle Coherence management framework to drive operational efficiency. Maven and WebSocket support across the platform and how developers can leverage these capabilities along with Toplink Data Services for Web and mobile development are highlighted.


Here is an excerpt:

... Oracle WebLogic Server lets customers build an application server infrastructure using standard Java Standard Edition (SE) and Java Enterprise Edition (EE) tools. This industry-leading application server platform provides tremendous deployment flexibility. If you are not yet ready for cloud, it offers a best-of-breed choice for deploying packaged and homegrown applications to run on conventional hardware platforms. When ready you can run your applications in a private cloud on conventional hardware platforms or engineered systems, or have your applications hosted by a third party vendor, such as Oracle Cloud, or mix them together in a hybrid cloud model...


  > DOWNLOAD THIS FREE RESOURCE NOW

Also, don't forget to join us for the Oracle WebLogic Server 12c, Release 12.1.2 launch event later this month:
July 31st, 10am, Pacific Time
Register

Thursday Jul 11, 2013

Oracle WebLogic Server 12.1.2 is available

Good news for Oracle WebLogic Server users! Oracle WebLogic Server 12.1.2 has been made available for download today.  See the press release for more on what is included in the overall Cloud Application Foundation 12c release.  


Oracle WebLogic Server is the #1 application server in the industry, enabling deployment from conventional systems to cloud environments. This means you can choose to deploy the same applications on standard Windows/Unix platforms, on Oracle Exalogic Elastic Cloud to leverage engineered systems optimizations, or in private or public clouds such as the Oracle Cloud. Oracle WebLogic Server 12.1.2 adds new capabilities that extend its leadership for all of these deployment environments. Here's a brief summary.


First, we've delivered enhancements to make Oracle WebLogic Server 12.1.2 the ideal mission critical cloud platform, with unmatched performance, scalability and availability. New integration features with Oracle Database 12c deliver availability, multi-tenancy and scalability benefits for your on-premise clouds using Oracle's latest database technology. Dynamic cluster support make it easy to create high-availability cluster configurations, and to scale them up or down as performance requirements dictate. Additional optimizations for Exalogic Elastic Cloud Systems deliver new performance benefits - up to 3x performance improvements for JMS applications.   Oracle Coherence 12.1.2 has also been released, with new powerful features that can be leveraged in mission-critical applications.


Second, we've simplified operations by delivering native cloud management - efficient, unified, built-in management capabilities that span the web server, application server and data grid tiers of your cloud infrastructure. Oracle HTTP Server, Oracle WebLogic Server and Oracle Coherence now share a common installation and patching framework for efficient provisioning. The WebLogic Management Framework has been extended to manage Oracle HTTP Server and Managed Coherence Server configurations.  We continue to enhance the manageability of Oracle WebLogic Server itself via management enhancements such as elastic JMS for scaling your JMS deployments.   A new release of Oracle Enterprise Manager 12c Release 3 complements and extends these capabilities.


Third, we continue to invest in providing a modern development platform that enables developers to accelerate delivery of innovative applications. Enhancements to our Maven integration with updated plug-ins, POMs and archetypes make it easier to use build Oracle WebLogic Server, Coherence, TopLink, and Fusion Middleware applications with Maven-based repositories and build systems. We've added support for the WebSocket protocol standard for delivery of rich, interactive applications for standard HTML5 and mobile clients. Oracle TopLink Data Services make it easy to generate RESTful interfaces to enterprise data sources and deliver services for rich client applications built with JavaScript or similar technologies.  Updated releases of Oracle JDeveloper, Oracle Enterprise Pack for Eclipse, and Oracle Application Development Framework are available with new features for productive application development.


Taken together, these new capabilities make Oracle WebLogic Server 12.1.2 a compelling platform for developing and deploying your next generation of applications, and upgrading your existing applications. You'll be hearing more about all of the above capabilities during the coming weeks. Some things you can do today:


1) Register for the upcoming Oracle Cloud Application Foundation Webcast to learn more about WebLogic Server 12.1.2 and the new Cloud Application Foundation 12c release.

2) Download Oracle WebLogic Server 12.1.2 from the Oracle Technology Network for free development and evaluation purposes.  Licensed customers should download the software from the Oracle Software Delivery Cloud site, which offers different licensing terms.

3) Read the Oracle WebLogic Server 12.1.2 whitepaper for an overview of new features and business benefits.

4) Review the product documentation for full details on all the new capabilities.

Thanks!

Will

Using Oracle JDBC Type Interfaces

One of the hot new features in Oracle database 12c is Application Continuity (AC).  The feature basically will detect that a connection has gone bad and substitute a new one under the covers (I'll talk about it more in another article).  To be able to do that, the application is given a connection wrapper instead of the real connection.  Wrappers or dynamic proxies can only be generated for classes based on interfaces.  The Oracle types, like REF and ARRAY, were originally introduced as concrete classes.   In WLS 10.3.6 and/or the JDBC 11.2.0.3 driver, there are new interfaces for the Oracle types that you will need to use to take advantage of this new AC feature.

First, some history so that you understand the needed API changes.  In the early days of WebLogic data source, any references to vendor proprietary methods were handled by hard-coded references.  Keeping up with adding and removing methods was a significant maintenance problem. At the peak of the insanity, we had over one thousand lines of code that referenced Oracle-proprietary methods and the server could not run without an Oracle jar in the classpath (even for DB2-only shops).  In release 8.1 in March 2003, we introduced wrappers for all JDBC objects such that we dynamically generated proxies that implement all public interface methods of, and delegate to, the underlying vendor object.  The hard-coded references and the maintenance nightmare went away and just as importantly, we could provide debugging information, find leaked connections, automatically close objects when the containing object closed, replace connections that fail testing, etc.  The Oracle types were concrete classes so proxies were generated for these classes implementing the WLS vendor interfaces weblogic.jdbc.vendor.oracle.*.  Applications can cast to the WLS vendor interfaces or use getVendorObj to access the underlying driver object. Later, we added an option to unwrap data types, with a corresponding loss of functionality like no debug information.

Although the focus of this article is Oracle types, the dynamic proxies work for any vendor.   For example, you can cast a DB2 connection to use a proprietary method  ((com.ibm.db2.jcc.DB2Connection)conn).setDB2ClientUser("myname").

Starting with Oracle driver 11.2.0.3, the database team needed wrappers for the new AC feature and introduced new interfaces.  For WebLogic data source users, that's good news - no more unwrapping, the weblogic.jdbc.vendor package is no longer needed, and it's all transparent.  Before you go and change your programs to use the new Oracle proprietary interfaces, the recommended approach is to first see if you can just use standard JDBC API's.  In fact, as part of defining the new interfaces, Oracle proprietary methods were dropped if there was an equivalent standard JDBC API or the method was not considered to add significant value.  This table defines the mapping.  The goal is to get rid of references to the first and second columns and replace them with the third column.

" align="center">Old Oracle types
Deprecated WLS Interface
New interfaces
oracle.sql.ARRAY
weblogic.jdbc.vendor.oracle.OracleArray
oracle.jdbc.OracleArray
oracle.sql.STRUCT
weblogic.jdbc.vendor.oracle.OracleStruct
oracle.jdbc.OracleStruct
oracle.sql.CLOB
weblogic.jdbc.vendor.oracle.OracleThinClob
oracle.jdbc.OracleClob
oracle.sql.BLOB
weblogic.jdbc.vendor.oracle.OracleThinBlob
oracle.jdbc.OracleBlob
oracle.sql.REF
weblogic.jdbc.vendor.oracle.OracleRef
oracle.jdbc.OracleRef

This is a job for a shell hacker!  Much of it can be automated and the compiler can tell you if you are referencing a method that has gone away - then check if the missing method is in the equivalent jdbc.sql interface (e.g., getARRAY() becomes the JDBC standard getArray()).

You can take a look at a sample program that I wrote to demonstrate all of these new interfaces at   https://blogs.oracle.com/WebLogicServer/resource/StephenFeltsFiles/OracleTypes.txt (note that this is actually a ".java" program). It covers programming with all of these Oracle types.  While use of Blob and Clob might be popular, Ref and Struct might not be used as much.  The sample program shows how to create, insert, update, and access each type using both standard and extension methods.  Note that you need to use the Oracle proprietary createOracleArray() instead of the standard createArrayOf(). Although the sample program doesn't use the standard createBlob() or createClob(), these are supported for the Oracle driver.

The API's can be reviewed starting with the 11.2.0.3 version of the Javadoc.  A copy is available at http://download.oracle.com/otn_hosted_doc/jdeveloper/905/jdbc-javadoc/oracle/jdbc/package-summary.html .

This is a first step toward using Application Continuity.  But it's also a good move to remove Oracle API's that will eventually go away and use standard JDBC interfaces and new Oracle interfaces.



Tuesday Jul 02, 2013

Part 1 - 12c Database and WLS - Overview

The download of Oracle 12c database became available on June 25, 2013.  There are some big new features in 12c database and WebLogic Server will take advantage of them. Immediately, we will support using 12c database and drivers with WLS 10.3.6 and 12.1.1.  With WLS 12.1.2, available July 11, 2013 (join the Online Launch Event on July 31st), additional functionality is supported (those rows in the table below with all "No" values will get a "Yes).  The following table maps the Oracle 12c Database features supported with various combinations of currently available WLS releases, 11g and 12c Drivers, and 11g and 12c Databases.

Feature WebLogic Server 10.3.6/12.1.1 with 11g drivers and 11gR2 DB WebLogic Server 10.3.6/12.1.1 with 11g drivers and 12c DB WebLogic Server 10.3.6/12.1.1 with 12c drivers and 11gR2 DB WebLogic Server 10.3.6/12.1.1 with 12c drivers and 12c DB
JDBC replay No No No Yes (Active GridLink only in 10.3.6, add generic in 12.1.1)
Multi Tenant Database No Yes (except set container) No Yes (except set container)
Dynamic switching between Tenants No No No No
Database Resident Connection pooling (DRCP) No No No No
Oracle Notification Service (ONS) auto configuration No No No No
Global Database Services (GDS) No Yes (Active GridLink only) No Yes (Active GridLink only)
JDBC 4.1 (using ojdbc7.jar files & JDK 7) No No Yes Yes

 The My Oracle Support (MOS) document covering this is "WebLogic Server 12.1.1 and 10.3.6 Support for Oracle 12c Database [ID 1564509.1]" at the link https://support.oracle.com/epmos/faces/DocumentDisplay?id=1564509.1.

The following documents are also key references:
12c Oracle Database Developer Guide http://docs.oracle.com/cd/E16655_01/appdev.121/e17620/toc.htm
12c Oracle Database Administrator's Guide http://docs.oracle.com/cd/E16655_01/server.121/e17636/toc.htm .

I plan to write some related blog articles not to duplicate existing product documentation but to introduce the features, provide some examples, and tie together some information to make it easier to understand.

How do you get started with 12c?  The easiest way is to point your data source at a 12c database.  The only change on the WLS side is to update the URL in your data source (assuming that you are not just upgrading your database).  You can continue to use the 11.2.0.3 driver jar files that shipped with WLS 10.3.6 or 12.1.1.  You shouldn't see any changes in your application.  You can take advantage of enhancements on the database side that don't affect the mid-tier.  On the WLS side, you can take advantage of using Global Data Service or connecting to a tenant in a multi-tenant database transparently.

If you want to use the 12c client jar files, it's a bit of work because they aren't shipped with WLS and you can't just drop in ojdbc6.jar as in the old days.  You need to use a matched set of jar files and they need to come before existing jar files in the CLASSPATH.  The MOS article is written from the standpoint that you need to get the jar files directly - download almost 1G and install over 600M footprint to get 15 jar files.  Assuming that you have the database installed and you can get access to the installation (or ask the DBA), you need to copy the 15 jar files to each machine with a WLS installation and get them in your CLASSPATH.  You can play with setting the PRE_CLASSPATH but the more practical approach may be to just update WL_HOME/common/bin/commEnv.sh directly.  There's a change in the transaction completion behavior (read the MOS) so if you think you might run into that, you will want to set -Doracle.jdbc.autoCommitSpecCompliant=false.  Also if you are running with Active GridLink, you must set -Doracle.ucp.PreWLS1212Compatible=true (how's that for telling you that this is fixed in WLS 12.1.2). 

Once you get the configuration out of the way, you can start using the new ojdbc7.jar in place of the ojdbc6.jar to get the new JDBC 4.1 API's.  You can also start using Application Continuity.  This feature is also known as JDBC Replay because when a connection fails you get a new one with all JDBC operations up to the failure point automatically replayed.  As you might expect, there are some limitations but it's an interesting feature.

 Obviously I'm going to focus on the 12c database features that we can leverage in WLS data source.  You will need to read other sources or the product documentation to get all of the new features.

PS Since this was written, WLS 12.1.2 is now available.  See blog entry Oracle WebLogic Server 12.1.2 is available for more information. There is an Online Launch Event on July 31st.

About

The official blog for Oracle WebLogic Server fans and followers!

Stay Connected

Search

Archives
« July 2013 »
SunMonTueWedThuFriSat
 
1
3
4
5
6
7
8
9
10
12
13
14
15
18
19
20
21
23
26
27
28
   
       
Today