Table Locking in Insert Command.


 
Thread Tools Search this Thread
Top Forums Programming Table Locking in Insert Command.
# 1  
Old 05-13-2013
Table Locking in Insert Command.

Hi,

i have a java based tool which does insert operation in a TABLE, and in parallel the same table is used by my C++ code which does select Query.

the Table will be always busy, but sometimes the table is getting locked when i try to make an insert, am bit confused whether the lock is because of SELECT query from my C++ code or by the INSERT QUERY from the java Tool.

Do i need to modify the Query if so how..? and from the google i learnt that select puts an internal LOCK.

currently am locking the table before insert below is my query

lock table table_name in exclusive mode nowait

and giving a commit after performing the DML operation so that lock will be removed automatically.

can anyone please solve my query.?

thanks,
senthil

Last edited by Scott; 05-13-2013 at 11:39 AM.. Reason: Crosspost. Closed
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Insert one table and update another with shellscript

I have a problem with my shell script. I want to insert data from file to table1(empty) and then, compare table1 with table2 and update some fields. The first part is correct, but the second part does not work. The only way it works is if after the first part I truncate table1 and run the script... (1 Reply)
Discussion started by: nika_mill
1 Replies

2. Shell Programming and Scripting

Insert bulk values in DB table using isql

Hello, Objective is to insert bulk values in DB table using isql. Following code tried: isql -SServer_name -Ddb_name -Uuser_name -Ppassword < file.txt cat file.txt for i in `cat data_value_file.txt` do insert into tempdb..temp_table11 values ('$i') go done cat... (3 Replies)
Discussion started by: manishdivs
3 Replies

3. UNIX for Advanced & Expert Users

Insert Command Creating Table Locking Problem

Hi, i have a java based tool which does insert operation in a TABLE, and in parallel the same table is used by my C++ code which does select Query. the Table will be always busy, but sometimes the table is getting locked when i try to make an insert, am bit confused whether the lock is... (9 Replies)
Discussion started by: senkerth
9 Replies

4. Shell Programming and Scripting

Insert script result into Oracle Table

Hi All, I want to insert STAT and ENDTIME values for each job in joblist into TBL_DAILY_STATUS table. Eg: insert into tbl_daily_status values(STAT,ENDTIME); Please help me on this. #!/bin/ksh joblist="com_abc_job com_abc_dot_job com_abc_seq com_abc_det" for i in $joblist do... (8 Replies)
Discussion started by: vichuelaa
8 Replies

5. UNIX for Dummies Questions & Answers

Bash script to insert data into an html table

hi, I need to create a bash shell script which picks up data from a text file and in the output file puts it into an html made table. I have to use sed and awk utilties to do this the input text file will contain data in the format: job name para1 para2 para3 para4 para4 1 ... (1 Reply)
Discussion started by: intern123
1 Replies

6. Web Development

INSERT data to a Database Table from a text file

If you have a text file and if you want to Insert data to your Database Table, You can do it with these queries LOAD DATA LOCAL INFILE '/path/yourTextFile.txt' INTO TABLE yourTableName FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '\n' (0 Replies)
Discussion started by: sitex
0 Replies

7. Shell Programming and Scripting

Insert into Oracle table thru UNIX - linux 2.6.9-89

Hi, I am trying to insert a record into a table (say dips_tbl) which resides in Oracle DB through a ksh script. I want to insert records into few of the table columns-not all. I'll give an e.g. for the date column "CREATE_DATE". For that I first execute SQL1="SELECT SYSDATE FROM DUAL" ... (1 Reply)
Discussion started by: dips_ag
1 Replies

8. Shell Programming and Scripting

select values from db1 table and insert into table of DB2

Hi I am having three oracle databases running in three different machine. their ip address is different. from one of the DB am able to access both the databases.(means am able to select values and insert values in to tables individually.) I need to fetch some data from DB1 table(say DB1 ip is... (2 Replies)
Discussion started by: aemunathan
2 Replies

9. Shell Programming and Scripting

Insert value to ORACLE table from sqlldr log

This is the sample sqlldr log: ------------------------------------------------------------------------------------------------------------ SQL*Loader: Release 9.2.0.7.0 - Production on Sun Feb 8 23:37:02 2009 Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved. Control... (13 Replies)
Discussion started by: aimy
13 Replies

10. Shell Programming and Scripting

need to insert two columns (or two feilds) at the begining of the table

Hey guys/gals, So here is what i'm starting with...its a Solaris patch diag output. bash-3.0# pca -l Using /var/tmp/patchdiag.xref from Oct/20/08 Host: seiftsx4140 (SunOS 5.10/Generic_127128-11/i386/i86pc) List: missing Patch IR CR RSB Age Synopsis ------ -- - -- --- ---... (3 Replies)
Discussion started by: zeekblack
3 Replies
Login or Register to Ask a Question
JODREPORTS(1)						      General Commands Manual						     JODREPORTS(1)

NAME
jodreports - use libjodreports-java directly from the command line to merge OpenDocument text with data SYNOPSIS
jodreports <template-document> <data-file> <output-document> DESCRIPTION
jodreports is a java program that merge OpenDocument text with data by using libjodreports-java. The command line tool is especially useful to test templates while you are adding instructions to them. You use a .properties or .xml file to contain the <data-file> to be merged into the template. The <template-document> needs to be an existing OpenDocument text with simple fields. A field that will be replaced with the value of a variable passed can be specified using the standard FreeMarker expression notation by typing the variable name into the doc- ument as follows Hi ${name}! here name will be replaced with the value passed in at runtime. However, mixing processing instructions and normal text into the document may become confusing and clutter the layout. So JOOReports pro- vides an alternative way of inserting fields. You can insert a visual field in OpenOffice.org Writer from the menu Insert / Fields / Other... (or just press Ctrl+F2), then click on the Functions tab and select Input field. Change the field Reference to JOOScript and in the following field Content enter the variable name (e.g. "$name"). This field will typically be displayed by Writer as a grayed rectangle with the variable name, while moving the mouse over it will reveal the field reference. This is a nice way of keeping processing instructions separate from the document layout and is thus the recommended approach. Whatever you specify as the field Reference will be treated as a FreeMarker ${...} expression, so it could also be something more complex than a simple variable name. To insert more advanced instructions, e.g. for conditionally displaying a portion of text, or repeating a table row for each item in a col- lection, you can use FreeMarker directives. A simple directive is assign. You can use it to define a new variable, for example [#assign totalPrice = unitPrice * quantity] Note that we always use the alternative (square bracket) syntax for FreeMarker directives. While it may be possible to insert this directive directly as text into the template, this does not always work (for reasons we'll see below) and as mentioned mixing instructions into the document is a practice we want to avoid anyway. For this reason, JOOReports lets you insert FreeMarker directives as scripts. You can insert a script in Writer from the menu Insert / Script..., then change the Script type to JOOScript and insert any FreeMarker directives in the script Text box. A script will be displayed by Writer as a small green rectangle, and you can double click on it to open it and modify it. So you directive will be executed at the point where the script has been inserted. This is ok for something like assign but as we'll see will not work for something like list. Alternatively, you can insert a FreeMarker directive in OpenOffice.org Writer from the menu Insert / Fields / Other... (or just press Ctrl+F2), then click on the Functions tab and select Input field. Change the field Reference to JOOScript and in the following field Con- tent enter the directive (e.g. "[#assign title='Mr.']"). Sample Open Document Template Again this provides a nice way to insert processing instructions and keept them separate from the document layout. The <output-document> is also an OpenDocument text and will be created as the result of the merge. JOOReports uses FreeMarker as its template engine. FILES
/usr/share/java/jodreports.jar AUTHOR
jodreports was written by Mirko Nasato <mirko@artofsolving.com> and Terry Liang <terry@polonious.com.au>. jodreports was packaged for the Debian project by Sascha Girrulat <sascha@girrulat.de>. This manual page was written by Sascha Girrulat <sascha@girrulat.de>, for the Debian project (and may be used by others). Most of the used information are reused from http://jodreports.sourceforge.net. User Manuals January 30, 2011 JODREPORTS(1)