Skip to main content

Hadoop Hive Session issue in weblogic data source

Hi Everyone,

Recently i come with a requirement about Hadoop Hive integration in Oracle SOA, For same i wrote a blog which you can find on below link.

https://oraclesoaosbbpmapi.blogspot.com/2019/03/hadoop-hive-data-base-fetching-records.html

After successfully configuring hive in weblogic, We faced a new issue which is about connection.

Before going deep about issue and solution let's see how HIVE DB manage connection on server side.


  • when ever we make a data base connection for HIVE DB, it create an internal session and generates a session id which is valid for a specific period of time which is configured on server level.
  • After that period of time Hive create a new session id and process the query.
How weblogic data source manage connection:
  • When we create a data source in weblogic, We define a connection pool size by which we can use existing connections which are not in use by any other resource by which weblogic minimize the connection cost.
Issue due to complete different behavior of connection management in both env:
  • We run a query around 11AM IST to fetch the data.
  • On hive DB we configured a session time out 30 minutes.
  • When we run a query again after 11:35AM, It will generate hive session error in place of re-creating a new connection in place of creating new session with hive.
Why no new connection is created:
  • When we configured weblogic data source and define connection pool, at that time we configured two properties which are
  • Initial capacity: We usually make it as 1.
  • Minimum capacity: We usually make it as 1.
  • Due to property Minimum Capacity, Weblogic always keep at-least one minimum connection in it's connection pool and when a resource request for a connection it releases same from it's pool with existing session ID which will invalidated after session time.
When you will run an instance, You will see below error message in SOA instance.

Invalid SessionHandle: SessionHandle [af5ff8d7-2f51-4d75-8d4c-52f15e049121]


How to fix this issue: 

There are total three solution that i found which will work without any failure.

  1. Data source connection pool configuration
  2. Hadoop Session time out configuration, It is not safe and guaranteed to work in all case.
  3. Data source based HIVE session management.

  • Hadoop Session time out configuration, It is not safe and guaranteed to work in all case:
    • Increasing the timeout for the Apache Hadoop environment for resolving the behavior:      In the Cloudera Manager (CM), navigate to: Hive > Configuration > Search: Session


  • Data source based HIVE session management: Add below properties in JDBC Connection string
    • jdbc:hive2://IP:10000/default?hive.server2.idle.session.timeout=3600ms
    • While configuring about connection string you may get below error if client side session handling is not enabled.
    • Test failed: Failed to open new session: org.apache.hive.service.cli.HiveSQLException: java.lang.IllegalArgumentException: Cannot modify hive.server2.idle.session.timeout at runtime. It is not in list of params that are allowed to be modified at runtime
    • For same you to make some change in hiveserver2 hive-site.xml file.
    • <property> <name>hive.security.authorization.sqlstd.confwhitelist</name> <value>hive.server2.idle.session.timeout</value> </property>Data source connection pool configuration

  • Weblogic data source connection pool:
    • Click on Hive data source
    • Go to connection pool tab
    • Search for initial capacity=0
    • Search for minimum capacity=0
    • Activate the change.

By any one the way, you can fix the issue.


Have question post me here!!!!!!!!!!

Comments

Popular posts from this blog

Solution for BPM standard dashboard & activity guide not working in Oracle SOA 12.2.1.0 C

As earlier i publish a post about different issue of Oracle BPM, After some oracle support i got to fixed them. Issue Blog Here... Issue 3:BPM 12.2.1 process workspace activity guide not working. if you have a normal BPM Process, then this is the issue. In order to have data populated in "Activity Guide" firstly you should create a BPMN Guided Business Process. Below you can find the documentation about activity guide and how to create a Guided Business Process: https://docs.oracle.com/middleware/1221/bpm/bpm-develop/GUID-F765955D-90A5-48D4-8D2A-2F01FBB539E3.htm#BPMPD901 And here is specified: " A Guided Business Process is modeled as an activity guide that is based on a business process. The Activity Guide includes a set of Milestones. A milestone is a contained set of tasks that the end user has to complete. A milestone is complete when the user successfully runs a specific set of tasks in the milestone. " And in the below chapters you will find the ...

Oracle SOA 12C rest adapter with Custom HTTP headers

Most existing web applications are connected through web services, which are commonly known as SOAP services. More and more users are relying on mobile devices for communication, and they’re looking for lighter ways to access enterprise information on the go. REST services are the answer for the mobile device platform, because they get rapid responses and fast access to data. Oracle SOA Suite 12 c  provides a complete set of service infrastructure components for designing, deploying, and managing composite applications. Oracle SOA Suite 12 c  enables services to be created, managed, and orchestrated into composite applications and business processes. Some time we have need to send HTTP headers in REST service, In OSB we use header component and add what ever is needed but in oracle SOA 12C it's little bit different. Let see how we can do it. Create one SOA Application. Create one SOA Sample project inside SOA Application. Go to composite and drag drop REST ...

Swagger API document from Any WADL & Schema in Oracle SOA

Hi everyone, Hope everyone is doing well these days, Recently i started a project work over how to generate swagger API document for your any REST API, In case if you don't know what is swagger please go and check " https://swagger.io/tools/swagger-editor/ ". It's a great and easy to use tool which will help to create user friendly, human readable form API documentation with extension for generating API client in different languages with capability of testing your API from same. What is swagger editor, Design, describe, and document your API on the first open source editor fully dedicated to OpenAPI-based APIs. The Swagger Editor is great for quickly getting started with the OpenAPI (formerly known as the Swagger Specification) specification, with support for Swagger 2.0 and OpenAPI 3.0.  What benefits you will get by using swagger, Runs Anywhere, The Editor works in any development environment, be it locally or in the web. Smart Feedback, Validate you...