Posts

Showing posts from March, 2019

Caused by: java.sql.SQLTimeoutException: ORA-01013: user requested cancel of current operation

Many times we encounter this error and think that there might be some JPA issue or network issue. However, the error is pretty explicit in its nature, but still not clear to ring the bell very first time. As the error says there is a timeout, and since Oracle is saying, we shall accept it. Another clue is "user requested cancel of current operation". This means that the connection was closed by the application server not the database server, hence it can be safely concluded that application has configured timeouts on transactions at its end. However, if you feel that this transaction should have been concluded within the application server limits, your doubt might be true. This problem can arise in case there is a lock on the record being updated by JPA or lock on the table in which JPA is attempting to insert. The lock is most probably being held by some other application, and since application server configuration is on aggressive SLA, the transaction is waiting its

git switch all projects on your local from one branch to other

Many a times we have to switch projects from one git branch to other in our workspaces. With handful of projects it is easy to do in your editor or to use command line. However if the number if projects is bigger, it become monotnous boring and cumbersome. Following is the simple shell script to help with that. The prerequisite is that all projects must be in same directory and your credentials are already set and saved for git repository. The script will show all branches for suggestion. Just select the one you want to switch to by simple copy and paste. #!/bin/bash COL='\033[0;33m' #Yellow RED_COL='\033[0;31m' RESETCOL='\033[0m' unset SELECTED_BRANCH START_DIR=`pwd` echo "select a branch you want to switch, from listed branches" for i in */ ; do if [ -d "$i/.git" ]; then echo -e "${COL}--##__ $i __##--${RESETCOL}" cd $i if [ -z $SELECTED_BRANCH ]; then branches=`git branch -a| sed -e

svn bulk update projects on your local from one branch to other

Many a times we have to switch projects from one svn branch to other in our workspaces. With handful of projects it is easy to do in your editor or to use command line. However if the number if projects is bigger, it become monotnous boring and cumbersome. Following is the simple Python program to help with your svn switches. Usage of program is very simple. Save the folowing program and execute it with python 3.x. Rest of the course is simple and interactive. import sys import subprocess PROJECT_DIR = "" SVN_BRANCH_OLD = "" SVN_BRANCH_NEW = "" if ( len (sys . argv) < 3 or len (sys . agrv) > 3 ): sys . stdout . write( " \033 [0;32m" ) print ( "Three arguments are required. First is parent directory where all projects reside." ) print ( "Second is name of current branch. Only provide the part of URL that has changed" ) print ( "Third is name of the branch, to which ou w