Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
oracle_rac_application_continuity [2020/10/22 12:05] andonovjoracle_rac_application_continuity [2020/10/22 12:13] (current) andonovj
Line 70: Line 70:
 Now that we have the service, let's run the simple application. The application itself is one, but we will run it with different connection settings: Now that we have the service, let's run the simple application. The application itself is one, but we will run it with different connection settings:
  
-====Application Source====+=====Application Source=====
 Below you can see the source which I have used: Below you can see the source which I have used:
  
Line 174: Line 174:
 Now that we have the code, we can run it one in a two ways: Now that we have the code, we can run it one in a two ways:
  
-====Noreplay Mode====+=====Noreplay Mode=====
 We can run that application standard without any application continuity as follows: We can run that application standard without any application continuity as follows:
  
Line 238: Line 238:
 </Code> </Code>
  
-<sxh> +=====Replay Mode===== 
-C:\Users\Julien>java -jar -Djava.util.logging.config.file=logging.properties.txt +In order to make the application aware of the featurewe have to start it with the Universal Connection pooling using the replay option. To do that, we can use THE SAME application but with different connection properties:
- C:\Users\Julien\Documents\NetBeansProjects\actest\dist\actest.jar all_out_loggi +
-ng2 +
-connection factory set +
-Using URL +
-jdbc:oracle:thin:@(DESCRIPTION (TRANSPORT_CONNECT_TIMEOUT=3) (RETRY_COUNT=20)( +
-FAILOVER=ON) (ADDRESS (PROTOCOL TCP)(HOST lparac-scan.myrac.com)(PORT 15 +
-21)) (CONNECT_DATA (SERVER = DEDICATED) (SERVICE_NAME = ACTEST))) +
-pool configuredtrying to get a connection+
  
-C:\Users\Julien+<Code:bash|Connection Properties> 
-</sxh>+[oracle@enode01 labs]$ cat actest_replay.properties 
 +username=scott 
 +password=tiger 
 +autoCommit=false 
 +# Use new 12.1 replay datasource 
 +datasource=oracle.jdbc.replay.OracleDataSourceImpl 
 +url=jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST= 
 +cluster01- 
 +scan)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=actest. 
 +example.com))) 
 +# UCP setting: 
 +ucp_pool_size=2 
 +ucp_validate_connection_on_borrow=true 
 +ucp_connection_wait_timeout=60 
 +# Think Time taken to process the results from the database. 
 +Time in milliseconds. 
 +# -1 means no sleep. 
 +thread_think_time=20 
 +# Number of concurrent threads running in the application 
 +# UCP is tuned to have MAX and MIN limit set to this 
 +number_of_threads=6 
 +verbose=true 
 +</Code> 
 + 
 +The properties are 99.9% the same, with the only difference of the: "datasource=oracle.jdbc.replay.OracleDataSourceImpl" property in the replay one: 
 + 
 +<Code:bash|Difference between Replay and No replay> 
 +[oracle@enode01 labs]$ diff actest_noreplay.properties 
 +actest_replay.properties 
 +5,6c5,6 
 +< # Use standard 12.1 datasource no replay 
 +< datasource=oracle.jdbc.pool.OracleDataSource 
 +--- 
 +> # Use new 12.1 replay datasource 
 +> datasource=oracle.jdbc.replay.OracleDataSourceImpl 
 +</Code> 
 + 
 +That way, the application will be able to reconnect after interrupted connection: 
 + 
 +<Code:bash|Interrupted Connection> 
 +[oracle@enode01 labs]$ ./runreplay.sh 
 +###################################################### 
 +Connecting to 
 +jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=clus 
 +ter01- 
 +scan)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=actest. 
 +example.com))) 
 +# of Threads : 6 
 +UCP pool size : 2 
 +Thread think time : 20 ms 
 +###################################################### 
 +2 active connections, avg response time from db 304 ms 
 +2 active connections, avg response time from db 45 ms 
 +2 active connections, avg response time from db 304 ms 
 +2 active connections, avg response time from db 45 ms 
 +2 active connections, avg response time from db 29 ms 
 +2 active connections, avg response time from db 32 ms 
 +2 active connections, avg response time from db 29 ms 
 +2 active connections, avg response time from db 18 ms 
 +2 active connections, avg response time from db 36 ms 
 +... (Interupted connection) 
 +2 active connections, avg response time from db 5962 ms 
 +2 active connections, avg response time from db 98 ms 
 +2 active connections, avg response time from db 61 ms 
 +2 active connections, avg response time from db 72 ms 
 +[oracle@enode01 labs]$ 
 + 
 +</Code>
  • oracle_rac_application_continuity.1603368338.txt.gz
  • Last modified: 2020/10/22 12:05
  • by andonovj