Multiple updates on dataset = concurrecny exception
I am getting concurrency exceptions whenever I try to update a dataset more than once. For example, if I fill a dataset, modify data, and then call the data.update method, it works fine. However, if I fill a dataset, modify data, call data.update, modify more data, and then call dataset.update again, I get a concurrency excetpion. I know that the table can be updated with no problem, and I do not get this problem on other data providers. It seems that ODP requires you to requery your dataset after each update, which doesn't seem correct to me. I tried requerying a dataset after each update and that does indeed work, but it seems unnecessary. A sample code snippet is below. Can someone let me know what I am missing.
In the snippet below, the "dataSet" variable is a dataset which has already been filled and one records has already been modified.
Dim command As New OracleCommand
command.Connection = connection
command.CommandText = sqlhelper.getStatement("evaluation", "update")
'first insert
adapter.TableMappings.Clear()
adapter.TableMappings.AddRange(sqlhelper.evaluation_table_mapping)
Dim cb As New OracleCommandBuilder(adapter)
adapter.SelectCommand = command
adapter.Update(dataSet, "egov_evaluation")
'2nd insert
'change some data
CType(dataSet.Tables(0).Rows(0), EvaluationDataSet.egov_evaluationRow).gov_agencies_attendees = "new test update"
adapter.TableMappings.Clear()
adapter.TableMappings.AddRange(sqlhelper.evaluation_table_mapping)
Dim newcb As New OracleCommandBuilder(adapter)
adapter.SelectCommand = command
adapter.Update(dataSet, "egov_evaluation")
Followup:
This issue was caused by the SQL statement generated by the command builder. For those who haven't seen it yet, the command builder will generate a sql statement like "UPDATE <table> set <column1> = <value1>, <column2> = <value2> where <column1> = <orig column1 value> and <column2> = <orig column2 value>"
So if any of the fields don't match up in the where clause, you get the concurrency exception. We were getting stale data, and another issue caused by a bad query generated from the command builder, but this is worked around by writing our own update statements.
The only annoying thing is that our app doesn't care about concurrency, so we actually wanted to turn off the concurrency checking in the where clause, but, such is life.
Similar Messages
-
Hi experts,
I still cant figure out how oracle handles multiple updates to the same row. For instance I have 3 update statements:
update supplier set supp_type = 'k' where supp_code = '1';
update supplier set supp_type = 'j' where supp_code = '1';
update supplier set supp_type = 'm' where supp_code = '1';
I keep getting the final result to be supp_type = 'k' where it should actually be 'm', but when i execute the mapping it shows 3 update operations, which baffled me as to how oracle handles simultaneous updates to same row. I even tried disabling parallel dml on the table object, but am unsure whether this actually helps. I try putting a sorter operator and then a key lookup operator after the sorter operator in my mapping to compare the supp_code field in the sorter with the target table's supp_code field to retrieve the relevant row to update, but instead of 3 update operations, it now updates all supp_type in all my records to NULL. Can anyone explain to me how i should go about dealing with this?Hi experts,
I just took a look at the code section generated for the key lookup operator named SUPPLIER_WH_SURRKEY01 and I feel something is wrong with the generated code. I have pasted the code section on the key lookup operator below.
ORDER BY
"SUPPLIER_CV"."RSID$" ASC ) *"SORTER" ON ( ( ( "SUPPLIER_WH_SURRKEY01"."EXPIRATION_DATE" = "SPIDERWEB2"."GET_EXPIRATI_0_EXPIRATI" ) ) AND ( ( "SUPPLIER_WH_SURRKEY01"."SUPPCODE" = "SORTER"."SUPP_CODE$1" ) ) )*
WHERE
( ( "SUPPLIER_WH_SURRKEY01"."SUPPKEY" IS NULL ) OR ( "SUPPLIER_WH_SURRKEY01"."SUPPKEY" = "SUPPLIER_WH_SURRKEY01"."SUPPKEY" ) );
Can anyone explain to me the codes in bold? I have no clue as to what it means? Furthermore, those bold-ed codes look similar to what I have expected to find in the where clause, except that instead of SUPPLIER_WH_SURRKEY01"."EXPIRATION_DATE" = "SPIDERWEB2"."GET_EXPIRATI_0_EXPIRATI", I expected to find
SUPPLIER_WH_SURRKEY01"."EXPIRATION_DATE" = '31-dec-4000', because my key lookup operator checks upon a constant with the value '31-dec-4000'. And the constant name is CONSTANT itself, while my mapping's name is SPIDERWEB2(not too sure why the generated code refers to my mapping name instead of my constant)
Edited by: user8915380 on 17-Mar-2010 00:52 -
how to do multiple updates in a single request?
thanks
jinHi Jin,
By using addBatch() method and executeBatch() method we can do multiple updates in a single request to database. For example:
Here we are doing n number of statements in a sinle statement.
public void insertBatchData() throws SQLException, IOException
BufferReader br = new BufferReader(new FileReader("movie.txt"));
statement = connection.createStatement();
try {
do {
title = br.readLine();
if(title ==null) break;
leadActor = br.readLine();
leadActress = br.readLine();
type = br.readLine();
dateOfRelease = br.readLine();
String sqlString = "INSERT INTO MOVIE VALUES('" title "','" leadActor "','"+leadActress+"','"+ type +"','"+dateOfRelease+"')";
statement.addBatch(sqlString);
}while(br.readLine() !=null);
statement.executeBatch();
}catch(Exception e) { }
finally {
statement.close();
br.close();
Hope this will help you.
Regards,
Anil.
Technical Support Engineer
Sun MicroSystems Inc, India -
FRM-40735 POST- UPDATE trigger raised unhandled exception ORA- 01403
FRM-40735 POST- UPDATE trigger raised unhandled exception ORA- 01403
I am getting the above error when i am trying to change the Assignment Category field of
an employee from Junior Staff to Senior Staff.
Navigation People> Enter & Maintain> (B)Assignment.
Kindly assist me to resolve this error.
Plz note there is a promotion that is suppose to be given to some employees in our company as of
01-APR-2010 so i had to open the closed payroll periods and do the changes. I managed to change for all
the 9 employees but 1 employee's assignment is giving me an error as follows :
FRM-40735 POST- UPDATE trigger raised unhandled exception ORA- 01403
The error displays after i try to save the changes made to the Assignment Category from Junior Staff to Senior Staff.
NB: i have also tried to switch off the custom code...but its giving me same error.
Also the element links have been defined for employment category on the links window.
please help!!
Edited by: 594647 on Jul 20, 2010 10:26 PMRelease 12.1.1.
OS is Red Hat Ent Ed 4
i am trying to change the employee assignment category from Junior to Senior. so when i am updating the assignment details on the assignment screen (Navigation is People >Enter & Maintain> Assignment) and trying to save, the system gives error on the status bar of the application as follows:
FRM-40735 POST- UPDATE trigger raised unhandled exception ORA- 01403
NB: Error is appearing on the Assignment screen.
Please help!!
Edited by: 594647 on Jul 21, 2010 2:48 PM -
How to show multiple messages for a single exception
hi
Please consider this example application created using JDeveloper 11.1.1.3.0
at http://www.consideringred.com/files/oracle/2010/MultipleMessagesExceptionApp-v0.01.zip
It has a class extending DCErrorHandlerImpl configured as ErrorHandlerClass in DataBindings.cpx .
Running the page and entering a value starting with "err" will result in an exception being thrown and multiple messages shown.
See the screencast at http://screencast.com/t/zOmEOzP4jmQ
To get multiple messages for a single exception the MyDCErrorHandler class is implemented like
public class MyDCErrorHandler
extends DCErrorHandlerImpl
public MyDCErrorHandler()
super(true);
@Override
public void reportException(DCBindingContainer pDCBindingContainer,
Exception pException)
if (pException instanceof JboException)
Throwable vCause = pException.getCause();
if (vCause instanceof MyMultiMessageException)
reportMyMultiMessageException(pDCBindingContainer,
(MyMultiMessageException)vCause);
return;
super.reportException(pDCBindingContainer, pException);
public void reportMyMultiMessageException(DCBindingContainer pDCBindingContainer,
MyMultiMessageException pException)
String vMessage = pException.getMessage();
reportException(pDCBindingContainer, new Exception(vMessage));
List<String> vMessages = pException.getMessages();
for (String vOneMessage : vMessages)
reportException(pDCBindingContainer, new Exception(vOneMessage));
}I wonder if calling reportException() multiple times is really the way to go here?
question:
- (q1) What would be the preferred use of the DCErrorHandlerImpl API to show multiple messages for a single exception?
many thanks
Jan Verveckenfyi
Looks like using MultipleMessagesExceptionApp-v0.01.zip in JDeveloper 11.1.1.2.0 (11.1.1.2.36.55.36) results in a different behaviour compared to when used in JDeveloper 11.1.1.3.0 (11.1.1.3.37.56.60)
see http://www.consideringred.com/files/oracle/img/2010/MultipleMessages-111130versus111120.png
When using JDeveloper 11.1.1.2.0 each exception seems to result in two messages where there is only one message (as intended/expected) per exception when using JDeveloper 11.1.1.3.0 .
(Could be somehow related to the question in forum thread "multiple callbacks to DCErrorHandlerImpl".)
But, question (q1) remains and is still about JDeveloper 11.1.1.3.0 .
regards
Jan -
How to merge with multiple updates
Hi All,
can someone help with merge and multiple updates when matched ?
create table foo
id number,
name varchar2(30),
col1 date,
col2 date
create table bar
id number,
name varchar2(30),
col1 date,
col2 date
insert into foo values ( 1, 'test1', sysdate + 30, sysdate);
insert into foo values ( 2, 'test2', sysdate + 30, sysdate);
insert into foo values ( 3, 'test3', sysdate + 30, sysdate);
MERGE INTO BAR T1
USING (SELECT id, NAME, col1, col2 FROM foo) T2
ON (T1.id = T2.id)
WHEN MATCHED THEN
UPDATE SET T1.NAME=T2.NAME where T1.Name != T2.Name
UPDATE SET T1.col1=T2.col1 where T1.col1 != T2.col1
UPDATE SET T1.col2=T2.col2 where T1.col2 != T2.col2
WHEN NOT MATCHED THEN
INSERT (ID, NAME, col1, col2 ) VALUES (t2.Id, t2.NAME, t2.col1, t2.col2);
Reason for having multiple updates to same row is i want to update the column only if name, col1, and col2 columns have changed. So, I want to first match by rows and then update the columns in bar that have changed in foo.
Any thoughts on how I might do this in merge ?. I get the foll. error
ERROR at line 6:
ORA-00933: SQL command not properly ended
Thanks
VissuI think you will be better off reading this link.
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_9016.htm#SQLRF01606
It will be something like this.
MERGE INTO BAR T1
USING (SELECT id, NAME, col1, col2 FROM foo) T2
ON (T1.id = T2.id)
WHEN MATCHED THEN
UPDATE SET T1.NAME=T2.NAME ,
t1.col1 = t2.col2 ,
t1.col2 = t2.col2
where T1.Name != T2.Name or t1.col1 != T2.col1 or t1.col2 != t2.col2
WHEN NOT MATCHED THEN
INSERT (ID, NAME, col1, col2 ) VALUES (t2.Id, t2.NAME, t2.col1, t2.col2);Please note this code is untested.
Regards
Raj -
How to handle multiple updates and creates sequentially
Hi All,
I have a requirement where multiple updates and creates will happen on an Order (say Purchase Order). I need to capture all these updates/creates and synchronize the other system in real time. In other words, as soon an order is updated/created in EBS, the same needs to be reflected in other system database.
I have thought of using a JMS queue that'll store all the incoming creates/updates and a BPEL process will keep polling this queue. But in this case how do I ensure the sequence in which the new instances will be created. e.g. create order message was picked first from the queue and an instance got created. While this instance was in execution, another update happened on the same order for which another instance got created. Now before the first instance could get completed and created an order, second instance is trying to update the custom database because of which it would fail. How to restrict second instance from running before the completion of the first one?
I have also thought of capturing Order Update/Create business events from EBS but there also the same problem. Instance created by Update event can try to do the update before the instance created by Order Create could create a new order.
Any method to solve this.
Any pointers/suggestions/approaches are more than welcome.
SOA Suite 11.1.1.3
Regards,
Neeraj Sehgalmaybe unit of order and unit of work can help you on that, though i haven't any experience on both topics :
http://download.oracle.com/docs/cd/E12840_01/wls/docs103/jms/uow.html
http://download.oracle.com/docs/cd/E12840_01/wls/docs103/jms/uoo.html
or the mediator supports some sort of sequencer, see : http://www.xenta.nl/blog/2010/05/14/oracle-soa-suite-11g-resequence-messages-in-mediator/ -
How to build a Report/Form sharing the same page and do multiple Updates
Hi, I´m building and APEX application (V4.2). Customer is demanding a report/form with the ability to do multiples Updates with only one click. For example, they check multiples "check box" for Aprpove and then only one click for "Apply Changes".
Thanks in advance,
Luis E ContrerasHi Luis,
If I understand you correctly you want to check a number of rows for approval and update their status. The jQuery function used looks for checked checkboxes. In your case that will correspond with an update on the IND_PROBACION column. You can simply log the PK column value of each checked row:
var pkS = $('.uReportStandard input[type=checkbox]:checked').map(
function() {
return $(this).parent().parent().find('td[headers="PK"] input').val();
).get().join(':');
$('#P1_PKS').val(pkS);
You need to replace PK with the actual column name of your primary key column, or rowid for that matter.
In your submit process you can simply set each IND_PROBACION to your apporval value for each pk stored in the P!_PKS item.
If you need further assistence, please set up an example on apex.oracle.com
Regards,
Vincent
http://vincentdeelen.blogspot.com -
Multiple UPDATE statement in a message
Hi Experts,
Here is a scenario where we need to send multiple UPDATE statements in single message
the structure is as below.
<Table_name> 0..unbounded occurrence
<action> UPDATE
<access>
<non key fields>
</access>
<key>
<key fields>
</key>
in the above case the node <Table_name> would occur multiple times, the issue is only the first occurrence of the update statement is executed, rest of the update statements are ignored.
did my approach is wrong, please help...
thanks.Bandana,
No your approach is not wrong. But you may need to tweak little bit to get your requirement correctly.
Please follow Raj or Jais reply in this threads:
JDBC Receiver - Multiple rows Update
JDBC receiver multiple records UPDATE
But with this approach it would be multiple calls. If I were you I would write SQL_DML statement to update all at once.
Regards,
---Satish -
Control multiple updates and queries within one transaction in JPA
Hi,
I have a question regarding control multiple updates and queries within one transaction. We are using EclipseLink 2.3.1. With below code, will I be able to:
- have all insert, update, select queries committed in one transaction;
- queryGetBalance will return the latest OrgBalance after update;
- if one fails, everything rolls back.
Thanks!
Jeffrey
PS: I realized that I cannot use em.getTransaction().begin() and em.getTransaction().commit(), since I am using JTA.
=============
@PersistenceContext(unitName="Test")
EntityManager em;
em.setFlushMode(FlushModeType.COMMIT);
newTransaction.setAmount(1000);
newTransaction.setType("check");
em.persist(newTransaction);
orgAudit.setUpdateUser("Joe")
orgAudit.setupUpdateTime(time);
em.merge(orgAudit);
Query queryUpdateBalance = em.createQuery("update OrgBalance o set o.balance = o.balance + :amount where orgId = :myOrgId");
queryUpdateBalance.setParameter("amount", 1000);
queryUpdateBalance.setParameter("myOrgId", 1234);
Query queryGetBalance = em.createQuery("select OrgBalance o where o.orgId = :myOrgId");
queryGetBalance.setHint("javax.persistence.cache.storeMode", CacheStoreMode.REFRESH);
queryGetBalance.setHint("javax.persistence.cache.retrieveMode", CacheRetrieveMode.BYPASS);
queryGetBalance.getResultList();
em.flush();
Edited by: JeffreyW on Dec 12, 2011 10:34 AMYes, the operation will be in a single transaction, assuming you are using a JTA managed SessionBean and the code is part of a SessionBean method.
-
I have a new 5s and everything has updated from the cloud except my iTune songs. They all show waiting since yesterday , how do I get to download
Do you have iTunes Match or Purchased songs?
If purchased, start iTunes Store > More... > Purchased > Music > re-download from here
If iTunes Match : http://support.apple.com/kb/TS4124 -
How to update the Dataset of a report running with universe?
I am facing some issue in cross-tab.
My requirement is , on click of any cell in cross-tab i want to convert it into editable cell.
Converting into editable cell is something which I achieved using below code:
function onCellClick(e) {
var text=this.innerHTML;
var text = $.trim(this.innerHTML);
$('<input />').attr({ type: 'text', name: 'text' }).appendTo($(this)).val(text).select().blur(
function () {
var newText = $(this).val();
$(this).parent().text(newText).find('input').remove();
var rIndex=$(this).closest('tr').index();
data.data[rIndex]=newText;
that.firePropertiesChanged(["data"]);
//that.firePropertiesChanged(["visSelection"]);
that.fireEvent("onSelect");
I just modified the sample code.
My report is running with universe.
Now I want to update the Dataset with this updated value.
Can anyone provide any help on the same?
ThanksHi Michael,
You got it right.
Let me tell you the whole story:
I have a weird requirement of creating editable grid. And the values which I edit into grid get saved into database.
By using javascript I am able to edit grid cell item into HTML.
Now after this I have two hitches:
1. I am not able to get the updated cell values in Design Studio. I think this issues goes to SDK side. I try to create a external script variable and use this into Design Studio.But somehow it always throw blank.
2. I am not able to update dataset. I know updating the dataset permanently is not possible as its getting created from universe. But I just want to update the dataset so that any change in measure values also update total of that column.
I start this thing this week only. So might be I am asking few stupid question. Please bear with me.
Thanks
Amit -
Update XDP datasets after fillong and saving static forms
Hi all,
I've got many static XFA forms, which does not behave the same way after filling-in and saving in Acrobat. Mosto of them updates the XDP datasets entry inside the XFA, but some of them does not. The result is, that after extracting the XDP from the pdf Form, the datasets contains just the default values and not the filled-in values.
Are there any rules for updating the datasets entry shen saving filled form?
Thanks for any help
JozefHi all,
I've got many static XFA forms, which does not behave the same way after filling-in and saving in Acrobat. Mosto of them updates the XDP datasets entry inside the XFA, but some of them does not. The result is, that after extracting the XDP from the pdf Form, the datasets contains just the default values and not the filled-in values.
Are there any rules for updating the datasets entry shen saving filled form?
Thanks for any help
Jozef -
friends,
I am getting the below error when multiple update queries.Please suggest me how to solve this issue.
ORA-00028: your session has been killed
ORA-01012: not logged on
ORA-01012: not logged on
ORA-01012: not logged onHi,
As you said that you have carried out multiple updates on DB.
Does it includes the DB link, source of updates which you performed.?? If yes, then pls re-check then there might be some network I/O problems else check the type of db links you are maintaing.
Further refer to
http://download.oracle.com/docs/cd/B10501_01/server.920/a96521/manproc.htm
- Pavan Kumar N -
Error updating the dataset!!
Hi,
Currently our endusers are working with SAP Lumira, automatic
update to 1.15.1, Build 879 was made; but what we can
see is that the
stories that were already generated with a version 1.14 and they try to
refresh this stories, SAP Lumira send a error message:
Error updating the dataset!!
No more details..
Steps to Reproduce
1. Open SAP Lumira
2. Open Story
3. Refresh Story with the same excel dataset.
4. Error
SAP Lumira 1.15.1 Build 879
Windows 7 Home Basic
Microsof Excel 2010Hi Tammy
The SAP nota doesn't apply..
Cause
The cause seemed to be something to do with a set of about 20,000 cells in a single column of the Excel sheet. --> We use just about 150 cells
The exact item that is causing the issue in the Excel file file is not found. --> The file is in the same route.
Resolution
Two solutions were found for this issue:
The column that was causing issues was a date column and the # symbol was used for null values. Replacing the # symbol with a blank in the data got this to work. --> Not symbol # on the file
2. Opening the Excel file up with another office tool like Libre Office and exporting it as a new Excel file fixes what ever is in the file causing the error. --> Still the same error
Maybe you are looking for
-
Can multiple people work on the same project at the same time with Creative Cloud for Teams?
We have a project we are working on, and since it needs to be done in record time, multiple people need to be able to access the most current version. Is there a way to work on one project concurrently, like on Google docs?
-
Photo slideshows for iDVD - iPhoto or iMovie?
I posted before because I encountered errors when I created a DVD that incorporated photo slideshows and movies. The slideshows were created in iDVD and the movies in iMovie. The dvd was full, and on the one occasion that the burn was "successful", t
-
Extend search in cad-desktop view document list
Hi, is it possible to extend the search in the cad desktop's view DOCUMENT LIST? when i click the button SEARCH i get to some kind of CV04N-Search. Is it possible to implement a new Tab? i want to search by a change service order and select all docum
-
N8 product code for (english,arabic,perisan) ??
hi dear i want product code of N8 with language of english and arabic and persian plz !!
-
Hi, I have uploaded a lot of documents in solution manager. Now i need to get a report that brings to me all documents with their url links. Anybody knows some report or some way to get this information?Thanks! Regards, Guido