JDBC or MySQL cache - update query
The following query is ok but only works after a second refresh of the page.
The query is manupulated by the URL:
UPDATE activiteiten SET afgerond = 'checked' WHERE id=6
UPDATE activiteiten SET afgerond = 'unchecked' WHERE id=6
The query works (without errors) but somethime the query was not executed. My teacher said he thought that it was the cache. He refers to ODBC because he known the problem there.
Maybe somebody here can help me to stop JDBC or MySQL caching, were can I configure it? Waiting for response, Adri
do a commit after your execution of statement..
Similar Messages
-
Sender jdbc adapter - no update query
hi ,
i am using pi 731 single stack.
the scenario is - PI has to pick data from view of a hana database. i am using jdbc sender for it.
pi will not have access to update the table,only pi can read the view of database.So,PI can't use UPDATE query.
If in jdbc sender channel ,I use SELECT query only and no UPDATE query - will it work ? what will happen if there are 100 records in the view and PI failed after fetching 43 records..will it pick from 44th record next time OR it will start from 0 again ?
rgdsHi SAP PI,
It has no sense to use the sender JDBC without update query because then always will be taken the same records.
If you cant update the source DB you only have the choice to talk with the DB administrators that they develop for you a stored procedure that it has to do the work to get different records in every PI access.
If the PI record process fail with impossible source database update update, the only way (afaik) is to do a PI alert and to communicate it to db sender administrators. There are another option like to store the data in a intermediate table, and so on but all possibilities that i can think now are not to enough good.
Regards. -
Update query not working in the JDBC sender Communication channel
Hi,
We are working on JDBC to File scenario. As per the configuration, XI should pick the data from SQL database every 20 secs and should update the corresponding flag. We are using subquery in the select and update statement as both header and detail tables are involved.
Now the issue is, select query is working fine but update statement is not working as expected. It is somehow updating some other records rather than doing for the ones selected by the adapter.
Moreover logSQLstatement is also not working. Hence we are unable to identify the records which are getting updated.
Please advise.Hi Rumi,
See Question 8. Transaction Handling (Sender) in [SAP Note 831162 - FAQ: XI 3.0 / PI 7.0 / PI 7.1 JDBC Adapter|https://websmp130.sap-ag.de/sap(bD1wdCZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=831162].
8. Transaction Handling (Sender)
Q: If I have the following configured in a JDBC Sender:
Select Query:
SELECT column FROM TABLENAME WHERE FLAG = "TRUE"
Update Query:
UPDATE TABLENAME SET FLAG = "FALSE" WHERE FLAG = "TRUE"
How do I know that the JDBC adapter will not update newly added rows (rows that were
added between the time that the SELECT and UPDATE queries were executed) that were
not read in the initial SELECT query?
A: The SELECT and the UPDATE are run in the same DB transaction, i.e. both statements
have the same view on the database.
Make sure that both statements use the same WHERE clause. An additional
requirement for the correct operation of this scenario is the configuration of
an appropriate transaction isolation level on the database
(i.e., repeatable_read or serializable). You might also consider using a
"SELECT FOR UPDATE" statement instead of a plain SELECT statement to
ensure proper locking on the database. "SELECT FOR UPDATE"
is not supported in MS SQL database. In this case please make use of an
appropriate transaction isolation level on the database. For more details
please contact your DB vendors.
After, see Transaction Handling Issues in [SAP Note 1039779 - JDBC Adapter issues(Escape character,Transaction handling)|https://websmp130.sap-ag.de/sap(bD1wdCZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=1039779].
Best Regards.
Pedro Baroni -
Does anyone know, in case of Sender JDBC adapter, how is the below handled:
Say we have the Select Query as below:
SELECT date FROM TABNAME where FLAG = "TRUE"
and the update query as below:
UPDATE TABNAME SET FLAG = "FALSE" where FLAG = "TRUE"
How do we know whether the adapter will not update the newly added rows (between the times the Select and Update queries were executed) that were not read in the corresponding Select Query.Hi,
We had a similar situation and following description tells you how we handled it:
1.DB Job was created and scheduled to run at regular intervals which changes the status of the records from FLAG = "TRUE" to an intermediate status, say for e.g. FLAG = "INTM".
2.Select and update statements were written as follows:
For e.g.
SELECT date FROM TABNAME where FLAG = "INTM"
UPDATE TABNAME SET FLAG = "FALSE" where FLAG = "INTM"
This solution is running in our Production environment smoothly.
Question of maintenance of these DB jobs comes into play.But its upto you to decide !!
Hope it helps !
Regards,
Sridhar -
Hi guys help me with this
1) What is the use of update query in jdbc adapter?
2) Why do we use the flag field in jdbc table ?Hi,
1) What is the use of update query in jdbc adapter?
The purpose of the Update Query in JDBC is to change the status of the processed records in the table.
That is when JDBC query is executed it select the records from the table in the Database and it sends to the Receiver.
After that it executes the Update query to change the status of the processed records in the Table.
2) Why do we use the flag field in jdbc table ?
Flag field in the table is used to identify which record is processed by Jdbc adapter. Initial stage it will have the status as 0 , if it is successfully processed then it will updated to 1.
Based on this we can identify processed records which is done by update query.
Regards
Sridhar Goli -
Not comitting database after the update query in jdbc
Hi all,
This is the first time I am posting this. I have query excuting on racle DB. This is update query. after executing the i have called commint using con.commit(). But still it is not showing the modifications in oracle db.
What could be went wrong? Any sugestion, please let me know. I think it is simple jdbc program. So i don't think i need to post the code. Application running in Unix machine.
Regards & thanks,
Nirmala Vijaya Sekhar VarreVijayTechM wrote:
Connection con = null;
Class.forName("oracle.jdbc.driver.OracleDriver");
hi all,
// following is the code
con = DriverManager.getConnection("jdbc:oracle:thin:@10.129.239.43:1529:PBILLING","BILLING","BILLING");
boolean test = con.getAutoCommit(); //here I am getting 'true'
String invoice_header_query = "update invoice_header set file_traffico = '" + zipFileName + "' where bill_ref_no = '" + billRefNo_ + "' and bill_ref_resets = '" + billRefResets_ + "' and arbor_instance_id = '" + arborID_ + "'";
System.out.println("invoice_header_query---->"+invoice_header_query);
smt = con.createStatement();
int x = stmt.executeUpdate(query); // Here x = 1 printing so it is updating the one record
// con.commit(); // Even I have tried call this method. But this will be useful when you are using the Transactioon.
Could you please tell me what went write. I am using ojdbc14.jar.
regards,
VijayPost with code tags and where is your claimed exception handling? -
Sender jdbc adapter....update query?
Dear Team,
we are selecting date from master database and client dont want to add any other field for update query.
using select option, how to avoid selecting duplication records.
can i use current date and time for selecting the records for every select statement?
if yes then how to do it and what we need to update in update query??
Regards,
ChinnaHi Chinna,
Check like this below.
The following SQL statement selects the product name, and price for today from the "Products" table:
SELECT ProductName, Price, Now() AS PerDate
FROM Products;
Similarly,
UPDATE ProductName, Price, Now() AS PerDate
FROM Products;
Regards,
Loordh. -
Whats wrong with my UPDATE query?????????
Hi friends,
I used an update query in my project but it doesnt seems to be work fine.
And here is my query:
String SQL1="UPDATE tbl_rmadetails SET serial_no="+serial_no+" AND replaced_serial_no="+replaced_serial_no+" AND status="+status+"AND customer_id="+custo+"AND item_id="+ite+" WHERE customer_id="+custo+"AND item_id="+ite;
Did i mess up the query..
Is it?
If not then whats the problem.
I use PreparedStatement to execute the query.
Any help will be appreciatedSo if i have 16 fields and i want to update only 5 fields means i gotta leave other fields like the below one..
String SQL2="UPDATE tbl_rmadetails SET serial_no="+serial_no+","+ "replaced_serial_no="+replaced_serial_no+","+ "status="+status+","+"customer_id="+custo+"," +"item_id="+ite+"WHERE customer_id="+custo+"AND item_id="+ite+" AND serial_no="+serial_no;
ps=con.prepareStatement(SQL2);
ps.setString(3,custo);
ps.setString(4,ite);
ps.setInt(8,serial_no);
ps.setInt(10,replaced_serial_no);
ps.setString(11,status);
x=ps.executeUpdate();It gives me an error like this one in my console...
java.sql.SQLException: Parameter index out of range (3 > 0).
at com.mysql.jdbc.PreparedStatement.setInternal(PreparedStatement.java:2
001)
at com.mysql.jdbc.PreparedStatement.setString(PreparedStatement.java:110
3)
at com.rajk.javacode.servlets.RMAEntryModel.updateOut(RMAEntryModel.java
:310)
at com.rajk.javacode.servlets.RMAOutServlet.doPost(RMAOutServlet.java:31
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ss(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44
7)
at java.lang.Thread.run(Unknown Source)I dont want to update other fields.. i leave them as it is.. i juz want to know whether i could update only necessary fields out of all?
ANyhelp would be appreciated -
Update query not working from edit page
Next incident with the guestbook saga:
Successful execution of gb_entry_mstr_det_e.cfm with URL:
http://www.benoitsystems.com/ww/bd/gb/gb_entry_mstr_det_e.cfm?call_number=14 all have database current info...this is good, but:
textboxes
Problem 1:
the SELECT field does not does not reflect/display the correct option I know exists in the database
the database field whence this SELECT object is supposed to display is a number, not text.
now,...
Problem 2:
Clicked on "Update Your Entry" button at bottom of edit page (to update by going to gb_confirm_update.cfm)
<INPUT
TYPE="submit"
NAME="submit"
VALUE="Update Your Entry">
then, arriving at the gb_confirm_update.cfm page, ...
Got an error (below) executing the page: gb_confirm_update.cfm with resulting URL:
http://www.benoitsystems.com/ww/bd/gb/gb_confirm_update.cfm?call_number=#gb_entryID#
--- snippet from template gb_confirm_update.cfm
<CFQUERY DATASOURCE="9130.ww" NAME="ww_gb_ud">
UPDATE gb_entries
SET
gb_entry_stts_='form.gb_entry_stts_',
gb_entry_nm_f='form.gb_entry_nm_f',
gb_entry_nm_l='form.gb_entry_nm_l',
gb_entry_nm_l_dspl_x=form.gb_entry_nm_l_dspl_x,
gb_entry_tce='form.gb_entry_tce',
gb_entry_tce_dspl_x=form.gb_entry_tce_dspl_x,
gb_entry_cy='form.gb_entry_cy',
gb_entry_stt='form.gb_entry_stt',
gb_entry_instr='form.gb_entry_instr',
gb_entry_m='form.gb_entry_m',
gb_entry_del_x=form.gb_entry_del_x
WHERE gb_entryID=form.gb_entryID
</CFQUERY>
--- end snippet ---
=================================================
Error Executing Database Query.
[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 4.
The error occurred in E:\benoitsystems.com\wwwroot\ww\bd\gb\gb_confirm_update.cfm: line 2
1 : <!--- <CFUPDATE DATASOURCE="9130.ww" TABLENAME="gb_entries"> --->
2 : <CFQUERY DATASOURCE="9130.ww" NAME="ww_gb_ud">
3 : UPDATE gb_entries
4 : SET
SQL UPDATE gb_entries SET gb_entry_stts_='form.gb_entry_stts_', gb_entry_nm_f='form.gb_entry_nm_f', gb_entry_nm_l='form.gb_entry_nm_l', gb_entry_nm_l_dspl_x=form.gb_entry_nm_l_dspl_x, gb_entry_tce='form.gb_entry_tce', gb_entry_tce_dspl_x=form.gb_entry_tce_dspl_x, gb_entry_cy='form.gb_entry_cy', gb_entry_stt='form.gb_entry_stt', gb_entry_instr='form.gb_entry_instr', gb_entry_m='form.gb_entry_m', gb_entry_del_x=form.gb_entry_del_x WHERE gb_entryID=form.gb_entryID
DATASOURCE 9130.ww
VENDORERRORCODE -3010
SQLSTATE 07002
Please try the following:
Check the ColdFusion documentation to verify that you are using the correct syntax.
Search the Knowledge Base to find a solution to your problem.
Browser Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Remote Address 71.233.234.226
Referrer http://www.benoitsystems.com/ww/bd/gb/gb_entry_mstr_det_e.cfm?call_number=14
Date/Time 21-Jul-10 03:11 PM
=================================================
I have every NAME of each object matching, verbatum, in the UPDATE query, and every database field name correct in teh query also.I was encouraged to send snippets in an another submission, and now I believe it is best that I "lay my cards on the table"
Here's my hand:
Pages in question for your review:
http://www.benoitsystems.com/ww/bd/gb/gb_mstr.cfm click on the pencil (the toilet will delete the record.
http://www.benoitsystems.com/ww/bd/gb/gb_entry_mstr_det_e.cfm?call_number=21 go to bottom of webpage and click “Update Your Entry”
http://www.benoitsystems.com/ww/bd/gb/gb_confirm_update.cfm?call_number=#gb_entryID#
In your review of the above (should you choose) before clicking on the pencil, look at the status on the master listing record you will be editing, and feel free to edit. Most statuses will be “Hold”
Two dummy MS Access database tables:
Table 1: "gb_entries" (Guestbook)
field 1: gb_entries_ID (Autonumber - Long Integer)
field 2: gb_entries_dt (date/time)
field 3: gb_entries_nm_f (Text)
field 4: gb_entries_nm_l (Text)
field 5: gb_entries_nm_stts_ (Number field - Byte (not bit)) (fed by gb_sttsID)
couple other text fields
field 6: gb_entries_em (Text)
field 7: gb_entries_cy (Text)
field 8: gb_entries_stt (Text)
field 9: gb_entries_nm_l_dspl (Yes/No or True/False)
field 10: gb_entries_m (Memo type)
Table 2: "gb_stts_rf" (Guestbook Status Reference)
field 1: gb_sttsID (Autonumber - Long Integer)
field 2: gb_stts (Text)
Two Templates:
This is the edit page (where a person with administrative access may edit the status or change the spelling for someone, etc.):
<!--- This query fills the form with the chosen record data (except for the darned SELECT object) ---> <CFQUERY NAME="edit_entry" DATASOURCE="9130.ww"> SELECT * FROM gb_entries WHERE #call_number#=gb_entryID </CFQUERY>
<!--- This query is for the select dropdown of guestbook status options (set to default on “Hold” from gb_nw.cfm) ---> <CFQUERY NAME="q_stts" DATASOURCE="9130.ww"> SELECT * FROM gb_stts_rf </CFQUERY>
<HTML>
<HEAD>
<TITLE>Woodwindology Guestbook Entry Edit Page</TITLE> <CFOUTPUT QUERY="incl_css_bd">#incl_code#</CFOUTPUT>
</HEAD>
<BODY
BGPROPERTIES="fixed">
<DIV ALIGN="center">
<IMG
SRC="<CFOUTPUT>#baseurl#</CFOUTPUT>md/img/ut/ttl/pg/guestbook.gif"
BORDER="0">
<BR>
<IMG
SRC="<CFOUTPUT>#baseurl#</CFOUTPUT>md/img/ut/ttl/sub/edit_entry.gif"
BORDER="0">
<BR>
Developer View
</DIV>
<TABLE>
<TR>
<TD>
<TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="5"
CELLSPACING="0">
<TR>
<TD VALIGN="top">
<FORM
NAME="f_gb_entry_mstr"
ACTION="gb_confirm_update.cfm?call_number=#gb_entryID#"
METHOD="post">
<CFOUTPUT QUERY="edit_entry">
<B>Entry ID:</B>
#gb_entryID#
<INPUT
TYPE="hidden"
NAME="gb_entryID"
VALUE="#gb_entryID#">
<P>
<B>Entry Date and Time:</B>
#DateFormat("#gb_entry_dt#","mmmm d, yyyy")# #TimeFormat("#gb_entry_dt#","h:mm tt")#
<P>
<B>Entry Status:</B>
<SELECT
NAME="gb_entry_stts_"
VALUE="#gb_entry_stts_#">
</CFOUTPUT>
<CFOUTPUT QUERY="q_stts">
<OPTION VALUE="#gb_sttsID#">#gb_stts#</OPTION>
</CFOUTPUT>
</SELECT>
<P>
<CFOUTPUT QUERY="edit_entry">
<B>Guest's First Name:</B>
<INPUT
TYPE="text"
NAME="gb_entry_nm_f"
VALUE="#gb_entry_nm_f#">
<P>
<B>Guest's Last Name:</B>
<INPUT
TYPE="text"
NAME="gb_entry_nm_l"
VALUE="#gb_entry_nm_l#">
<BR>
Display Last Name:
<INPUT
TYPE="radio"
NAME="gb_entry_nm_l_dspl_x"
VALUE="Yes">
Do Not Display Last Name:
<INPUT
TYPE="radio"
NAME="gb_entry_nm_l_dspl_x"
VALUE="no">
<P>
<B>Your Email Address:</B><BR>
<INPUT
TYPE="text"
NAME="gb_entry_tce"
VALUE="#gb_entry_tce#"
SIZE="40"
MAXLENGTH="40">
<BR>
Uncheck the box to keep email private:
<INPUT
TYPE="checkbox"
NAME="gb_entry_tce_dspl_x"
VALUE="#gb_entry_tce_dspl_x#">
<P>
<SPAN CLASS="emph01">*</SPAN> Your City:
<INPUT
TYPE="text"
NAME="gb_entry_cy"
VALUE="#gb_entry_cy#"
SIZE="30">
<P>
<SPAN CLASS="emph01">*</SPAN> Your State:
<INPUT
TYPE="text"
NAME="gb_entry_stt"
VALUE="#gb_entry_stt#"
SIZE="30">
<BR>
<B>Instruments Played:</B>
<BR>
<TEXTAREA
COLS="45"
MAX="50" -
Pof Serialization Error leads to partial cache updates in XA Tran
I am using coherence jca adapter to enlist in XA transactions with the database operations. The data is being stored in distributed caches with the cache member running on weblogic server with "Storage disabled". POF is being used for serialization. As a part of a single transaction, multiple caches, which are obtained from the CacheAdapter, are being updated. The application code does explicit updates to the cache and the database within the same transaction with the write to the cache happening after the write the database has been executed.
It is being observed that when an exception happens during the serialization of an object all the cache updates prior to this error are not rolled back. Namely,
I have CacheA for Object A, Cache B for Object B and Cache C for Object C.
I am updating A, B, C with the same transaction and in the same order as the objects are listed. So database for A is updated followed by cache update for A, DataBase B is updated followed by Cache update for B and similarly for C.
If there is an error while serializing C, all the database updates are rolled back, however updates to A and B are committed to the cache.
Why aren't all the cache updates being rolled back ? Has this been fixed already in coherence 3.6.
Thanks,
Shamsur
Application Server: Weblogic 10.3
jdbc driver : XA thin driver
coherence : 3.5.0
Caused by: java.lang.IllegalStateException: decimal value exceeds IEEE754r 128-bit range: 7777777788888888888899999999999900000000000000044444444444447777777777777.00
at com.tangosol.io.pof.PofHelper.calcDecimalSize(PofHelper.java:1517)
at com.tangosol.io.pof.PofBufferWriter.writeBigDecimal(PofBufferWriter.java:562)
at com.tangosol.io.pof.PofBufferWriter.writeObject(PofBufferWriter.java:1325)
at com.tangosol.io.pof.PofBufferWriter$UserTypeWriter.writeObject(PofBufferWriter.java:2092)
at com.apx.core.datalayer.data.basictypes.BigDecimalMoneyImpl.writeExternal(BigDecimalMoneyImpl.java:127)
at com.tangosol.io.pof.PortableObjectSerializer.serialize(PortableObjectSerializer.java:88)
at com.tangosol.io.pof.PofBufferWriter.writeObject(PofBufferWriter.java:1439)
at com.tangosol.io.pof.PofBufferWriter$UserTypeWriter.writeObject(PofBufferWriter.java:2092)
at com.apx.instrument.datalayer.data.domain.impl.DOtcInstrumentImpl.writeExternal(DOtcInstrumentImpl.java:200)
at com.apx.core.datalayer.data.impl.AbstractDomainObject.writeExternal(AbstractDomainObject.java:109)
... 185 more
at com.tangosol.coherence.ra.component.connector.resourceAdapter.cciAdapter.CacheAdapter$ManagedConnection$LocalTransaction.commit(CacheAdapter.CDB:37)
at weblogic.connector.security.layer.AdapterLayer.commit(AdapterLayer.java:570)
at weblogic.connector.transaction.outbound.NonXAWrapper.commit(NonXAWrapper.java:84)
at weblogic.transaction.internal.NonXAServerResourceInfo.commit(NonXAServerResourceInfo.java:330)
at weblogic.transaction.internal.ServerTransactionImpl.globalPrepare(ServerTransactionImpl.java:2251)
at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:270)
at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:230)
at weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:283)
at $Proxy150.create(Unknown Source)
javax.resource.spi.LocalTransactionException: CoherenceRA: Commit failed:
java.lang.RuntimeException: error with the class: com.apx.instrument.datalayer.data.domain.impl.DOtcInstrumentImpl
at com.apx.core.datalayer.data.impl.AbstractDomainObject.writeExternal(AbstractDomainObject.java:111)
at com.tangosol.io.pof.PortableObjectSerializer.serialize(PortableObjectSerializer.java:88)
at com.tangosol.io.pof.PofBufferWriter.writeObject(PofBufferWriter.java:1439)
at com.tangosol.io.pof.ConfigurablePofContext.serialize(ConfigurablePofContext.java:338)
at com.tangosol.util.ExternalizableHelper.serializeInternal(ExternalizableHelper.java:2508)
at com.tangosol.util.ExternalizableHelper.toBinary(ExternalizableHelper.java:205)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$ConverterValueToBinary.convert(DistributedCache.CDB:3)
at com.tangosol.util.ConverterCollections$AbstractConverterEntry.getValue(ConverterCollections.java:3333)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$BinaryMap.putAll(DistributedCache.CDB:19)
at com.tangosol.util.ConverterCollections$ConverterMap.putAll(ConverterCollections.java:1570)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$ViewMap.putAll(DistributedCache.CDB:1)
at com.tangosol.coherence.component.util.SafeNamedCache.putAll(SafeNamedCache.CDB:1)
at com.tangosol.coherence.component.util.collections.WrapperMap.putAll(WrapperMap.CDB:1)
at com.tangosol.coherence.component.util.DeltaMap.resolve(DeltaMap.CDB:9)
at com.tangosol.coherence.component.util.deltaMap.TransactionMap.commit(TransactionMap.CDB:1)
at com.tangosol.coherence.component.util.TransactionCache.commit(TransactionCache.CDB:14)
at com.tangosol.coherence.component.util.transactionCache.Local.commit(Local.CDB:1)
at com.tangosol.coherence.ra.component.connector.resourceAdapter.cciAdapter.CacheAdapter$ManagedConnection$LocalTransaction.commit(CacheAdapter.CDB:25)
at weblogic.connector.security.layer.AdapterLayer.commit(AdapterLayer.java:570)
at weblogic.connector.transaction.outbound.NonXAWrapper.commit(NonXAWrapper.java:84)
at weblogic.transaction.internal.NonXAServerResourceInfo.commit(NonXAServerResourceInfo.java:330)
at weblogic.transaction.internal.ServerTransactionImpl.globalPrepare(ServerTransactionImpl.java:2251)
at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:270)
at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:230)
at weblogic.transaction.internal.TransactionManagerImpl.commit(TransactionManagerImpl.java:283)
at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1009)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:374)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:120)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)Hi SR-APX
The problem is that even though you are using the JCA adaptor Coherence (pre-3.6) is not really transactional. Once you commit all that data is still being pushed out to the distributed cluster members who all work independently. An error on one member will not stop data being written successfully to others.
In Coherence 3.6 there are real transactions but you would need to see if the limitations on them fit your use-cases.
JK -
We have an update query recently brought to my attention that is running extremely slow on Oracle 11.2.0.1 against a secure file binary XML table using
update /*+ NO_XML_DML_REWRITE */croutreach.action set object_value = :1 where actn_id = :2 .
I am told the majority/near majority of the ~ 16 fields are updated. Also this table has numerous predefined virtual columns with fn based indexes on them.
My first inclination was to recast this using the Oracle updatexml function. I was told, the /*+ NO_XML_DML_REWRITE */ hint would also be necessary here.
update /*+ NO_XML_DML_REWRITE */
<tble_name> a
set a.object_value = updatexml(a.object_value ...).
Last year our dba's were instructed by Oracle Support to use this hint, as the update wasn't updating any records w.o any error msgs.
+1. Hoping to find out if anyone has run across using this hint in some capacity and what was their experience?+
In trying to optimizie this update statement, I'll start from scratch not using the /*+ NO_XML_DML_REWRITE */ hint and will commence with using the updatexml function with setting up an xmlindex.
+2. Hoping to receive some suggestions on creating the proper xmlindex - figuring an unstructured index. If get some good performance with the xmlindex; hoping to retire some of the virtual column usage.+
+3. Any suggestions on living with virtual columns in conjunction with xmlindexes? See the action table definition and associated ivirtual columns and indexes. This table seems over indexed...+
REATE
TABLE "CROUTREACH"."ACTION" OF XMLTYPE
CONSTRAINT "ACTN_ID_PK" PRIMARY KEY ("ACTN_ID") USING INDEX PCTFREE 10
INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT
1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1
FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE
DEFAULT) TABLESPACE "ACME_DATA" ENABLE
XMLTYPE STORE AS SECUREFILE BINARY XML
TABLESPACE "ACME_DATA" ENABLE STORAGE IN ROW CHUNK 8192 CACHE READS LOGGING
NOCOMPRESS KEEP_DUPLICATES STORAGE(INITIAL 106496 NEXT 1048576 MINEXTENTS 1
MAXEXTENTS 2147483645 PCTINCREASE 0 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT
CELL_FLASH_CACHE DEFAULT)
ALLOW NONSCHEMA ALLOW ANYSCHEMA VIRTUAL COLUMNS
*"ACTION_DEF_URN"* AS (CAST(SYS_XQ_UPKXML2SQL(SYS_XQEXVAL(XMLQUERY(
'declare default element namespace "http://www.cigna.com/acme/domains/actions/2010/03"; (::)
/action/srvContextPointer/outreachActionDefInfo/@actionDefUrn
PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
16777216,0),50,1,2) AS VARCHAR2(50))),
*"STAT_DT"* AS (SYS_EXTRACT_UTC(CAST(TO_TIMESTAMP_TZ(SYS_XQ_UPKXML2SQL(
SYS_XQEXVAL(XMLQUERY(
'declare default element namespace "http://www.cigna.com/acme/domains/actions/2010/03"; (::)
/action/@status_dt'
PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
16777216,0),50,1,2),'SYYYY-MM-DD"T"HH24:MI:SS.FFTZH:TZM') AS TIMESTAMP
WITH
TIME ZONE))),
*"ACT_DEF_ID"* AS (CAST(SYS_XQ_UPKXML2SQL(SYS_XQEXVAL(XMLQUERY(
'declare default element namespace "http://www.cigna.com/acme/domains/actions/2010/03"; (::)
/action/srvContextPointer/outreachActionDefInfo/@actionDefId'
PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
16777216,0),50,1,2) AS VARCHAR2(20))),
*"CORRL_ID"* AS (CAST(SYS_XQ_UPKXML2SQL(SYS_XQEXVAL(XMLQUERY(
'declare default element namespace "http://www.cigna.com/acme/domains/actions/2010/03"; (::)
/action/correlationId'
PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
16777216,0),50,1,2) AS VARCHAR2(50))),
*"STAT_RSN"* AS (CAST(SYS_XQ_UPKXML2SQL(SYS_XQEXVAL(XMLQUERY(
'declare default element namespace "http://www.cigna.com/acme/domains/actions/2010/03"; (::)
/action/statusReason'
PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
16777216,0),50,1,2) AS VARCHAR2(30))),
*"ACT_APPNT_DT"* AS (SYS_EXTRACT_UTC(CAST(TO_TIMESTAMP_TZ(SYS_XQ_UPKXML2SQL(
SYS_XQEXVAL(XMLQUERY(
'declare default element namespace "http://www.cigna.com/acme/domains/actions/2010/03"; (::)
/action/actionAppointment/appointment_dt'
PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
16777216,0),50,1,2),'SYYYY-MM-DD"T"HH24:MI:SS.FFTZH:TZM') AS TIMESTAMP
WITH
TIME ZONE))),
*"UPDT_DT"* AS (SYS_EXTRACT_UTC(CAST(TO_TIMESTAMP_TZ(SYS_XQ_UPKXML2SQL(
SYS_XQEXVAL(XMLQUERY(
'declare default element namespace "http://www.cigna.com/acme/domains/actions/2010/03"; (::)
/action/@update_dt'
PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
16777216,0),50,1,2),'SYYYY-MM-DD"T"HH24:MI:SS.FFTZH:TZM') AS TIMESTAMP
WITH
TIME ZONE))),
*"CRET_DT"* AS (SYS_EXTRACT_UTC(CAST(TO_TIMESTAMP_TZ(SYS_XQ_UPKXML2SQL(
SYS_XQEXVAL(XMLQUERY(
'declare default element namespace "http://www.cigna.com/acme/domains/actions/2010/03"; (::)
/action/@create_dt'
PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
16777216,0),50,1,2),'SYYYY-MM-DD"T"HH24:MI:SS.FFTZH:TZM') AS TIMESTAMP
WITH
TIME ZONE))),
*"ACT_SEQ"* AS (CAST(TO_NUMBER(SYS_XQ_UPKXML2SQL(SYS_XQEXVAL(XMLQUERY(
'declare default element namespace "http://www.cigna.com/acme/domains/actions/2010/03"; (::)
/action/srvContextPointer/outreachActionDefInfo/@sequence'
PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
16777216,0),50,1,2)) AS NUMBER(10))),
*"SERVICE_DEF_URN"* AS (CAST(SYS_XQ_UPKXML2SQL(SYS_XQEXVAL(XMLQUERY(
'declare default element namespace "http://www.cigna.com/acme/domains/actions/2010/03";
/action/srvContextPointer/serviceDefUrn'
PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
16777216,0),50,1,2) AS VARCHAR2(100))),
*"ASSIGN_TEAM_CD"* AS (CAST(SYS_XQ_UPKXML2SQL(SYS_XQEXVAL(XMLQUERY(
'declare default element namespace "http://www.cigna.com/acme/domains/actions/2010/03"; (::)
/action/assignment/@teamCategoryCode'
PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
16777216,0),50,1,2) AS VARCHAR2(50))),
*"ASSIGN_STAFF_ID"* AS (CAST(SYS_XQ_UPKXML2SQL(SYS_XQEXVAL(XMLQUERY(
'declare default element namespace "http://www.cigna.com/acme/domains/actions/2010/03"; (::)
/action/assignment/staffProfileId'
PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
16777216,0),50,1,2) AS VARCHAR2(50))),
*"ACTION_TYPE"* AS (CAST(SYS_XQ_UPKXML2SQL(SYS_XQEXVAL(XMLQUERY(
'declare default element namespace "http://www.cigna.com/acme/domains/actions/2010/03"; (::)
declare namespace xsi="http://www.w3.org/2001/XMLSchema-instance"; (::)
local-name-from-QName(QName("http://www.cigna.com/acme/domains/actions/2010/03",/action/@xsi:type))
PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
16777216,0),50,1,2) AS VARCHAR2(50))),
*"ACTN_ID"* AS (CAST(SYS_XQ_UPKXML2SQL(SYS_XQEXVAL(XMLQUERY(
'declare default element namespace "http://www.cigna.com/acme/domains/actions/2010/03";/action/@id'
PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
16777216,0),50,1,2) AS VARCHAR2(50))),
*"STATUS"*AS (CAST(SYS_XQ_UPKXML2SQL(SYS_XQEXVAL(XMLQUERY(
'declare default element namespace "http://www.cigna.com/acme/domains/actions/2010/03";/action/@status'
PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
16777216,0),50,1,2) AS VARCHAR2(20))),
*"ACME_MBR_ID"* AS (CAST(SYS_XQ_UPKXML2SQL(SYS_XQEXVAL(XMLQUERY(
'declare default element namespace "http://www.cigna.com/acme/domains/actions/2010/03";/action/acmeMemberId'
PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
16777216,0),50,1,2) AS VARCHAR2(50)))
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE
INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0
FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT
CELL_FLASH_CACHE DEFAULT
TABLESPACE "ACME_DATA" ;
CREATE UNIQUE INDEX *"CROUTREACH"."SYS_C0014547"* ON "CROUTREACH"."ACTION"
"SYS_NC_OID$"
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE
INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0
FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT
CELL_FLASH_CACHE DEFAULT
TABLESPACE "ACME_DATA" ;
CREATE UNIQUE INDEX *"CROUTREACH"."SYS_IL0000082156C00003$$"* ON "CROUTREACH".
"ACTION"
PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE(INITIAL 65536 NEXT 1048576
MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST
GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "ACME_DATA" PARALLEL (DEGREE 0 INSTANCES 0) ;
CREATE UNIQUE INDEX *"CROUTREACH"."ACTN_ID_PK"* ON "CROUTREACH"."ACTION" (
"ACTN_ID") PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(
INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0
FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT
CELL_FLASH_CACHE DEFAULT) TABLESPACE "ACME_DATA" ;
CREATE
INDEX *"CROUTREACH"."ACTION_STAT_RSN_IDX"* ON "CROUTREACH"."ACTION"
"STAT_RSN"
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE
INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE
0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT
CELL_FLASH_CACHE DEFAULT
TABLESPACE "ACME_DATA" ;
CREATE
INDEX *"CROUTREACH"."ACTION_UPDT_DT_IDX"* ON "CROUTREACH"."ACTION"
"UPDT_DT"
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE
INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE
0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT
CELL_FLASH_CACHE DEFAULT
TABLESPACE "ACME_DATA" ;
CREATE
INDEX *"CROUTREACH"."ACTION_CRET_DT_IDX"* ON "CROUTREACH"."ACTION"
"CRET_DT"
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE
INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE
0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT
CELL_FLASH_CACHE DEFAULT
TABLESPACE "ACME_DATA" ;
CREATE
INDEX *"CROUTREACH"."ACTION_STAT_DT_IDX"* ON "CROUTREACH"."ACTION"
"STAT_DT"
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE
INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE
0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT
CELL_FLASH_CACHE DEFAULT
TABLESPACE "ACME_DATA" ;
CREATE
INDEX *"CROUTREACH"."ACTION_MBRID_TYP_STAT_IDX"* ON "CROUTREACH"."ACTION"
"ACME_MBR_ID",
"ACTION_TYPE",
"STATUS"
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE
INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE
0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT
CELL_FLASH_CACHE DEFAULT
TABLESPACE "ACME_DATA" ;
CREATE
INDEX *"CROUTREACH"."ACT_ACTDEF_URN_IDX"* ON "CROUTREACH"."ACTION"
"ACTION_DEF_URN"
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE
INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE
0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT
CELL_FLASH_CACHE DEFAULT
TABLESPACE "ACME_DATA" ;
CREATE
INDEX *"CROUTREACH"."ACTION_ACT_DEF_ID_STATUS_IDX"* ON "CROUTREACH"."ACTION"
"ACT_DEF_ID",
"STATUS"
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE
INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE
0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT
CELL_FLASH_CACHE DEFAULT
TABLESPACE "ACME_DATA" ;Any suggestions much appreciated.
Regards,
Richard Blanchardodie 63
update /*+ NO_XML_DML_REWRITE */croutreach.action set object_value = :1 where actn_id = :2 .
This update pattern is used in the production environment and is slowing the environment down as more xml content is increased. In a new release build, this update pattern against the action table described earlier, is particularly problematic.
Have some more information on the /*+ NO_XML_DML_REWRITE */ hint. It turns out, last year, updates statements would intermittently fail to correctly update silently failing. An Oracle Service Request was created. Over the span of about 5 mnths, Oracle determined a very low level Oracle kernel bug was the culprit. Oracle As a result of this SR, Oracle SUpport created BUG 11939507 <ORA-08102: index key not found during update on xmltable with a virtual column>. This bug is viewable on metalink. Oracle claims this bug has only been oberved on In the interim to 11.2.0.3, Oracle Support mentioned to use /*+ NO_XML_DML_REWRITE */; thus disabling piecewise update.
Here's preface information on this bug:
Bug 11939507: ORA-08102: INDEX KEY NOT FOUND DURING UPDATE ON XMLTABLE WITH VIRTUAL COLUMN
Bug Attributes
Type B - Defect Fixed in Product Version 12.1
Severity 2 - Severe Loss of Service Product Version 11.2.0.1
Status 80 - Development to Q/A Platform 23 - Oracle Solaris on SPARC (64-bit)
Created 30-Mar-2011 Platform Version 10
Updated 13-Feb-2012 Base Bug -
Database Version 11.2.0.1
Affects Platforms Generic
Product Source Oracle
Hdr: 11939507 11.2.0.1 XDB 11.2.0.1 BINARY PRODID-5 PORTID-23
Abstract: ORA-8102: INDEX KEY NOT FOUND DURING UPDATE ON XMLTABLE WITH VIRTUAL COLUMN*** 03/30/11 12:22 pm ***
BUG TYPE CHOSEN =============== code
Component: XML Database =======================
DETAILED PROBLEM DESCRIPTION ============================
The issue happens intermittently when running a batch program with 50 concurrent sessions that involves high concurrent updates.
DIAGNOSTIC ANALYSIS =================== reproducible testcase on customer dummy data reproduced by Thomas.
WORKAROUND? =========== No
TECHNICAL IMPACT ================ Customer is experiencing this error which is critical to the application because it causes a home health care provider to possibly lose a couple hours worth of work and have to start from scratch. The condition has only accessed concurrently from about 40 threads
RELATED ISSUES (bugs, forums, RFAs) =================================== Bug 8514561 - ORA-8102 WHEN UPDATING TABLE
HOW OFTEN DOES THE ISSUE REPRODUCE AT CUSTOMER SITE? ==================================================== Intermittent
DOES THE ISSUE REPRODUCE INTERNALLY? ==================================== Intermittent
IS A TESTCASE AVAILABLE? ======================== Yes The good news is, this bug is corrupting a virtual index column.
I'll try test cases using the update pattern; 'update /*+ NO_XML_DML_REWRITE */croutreach.action set object_value = :1 where actn_id = :2 ' - substituting actual values for the bind variables and removing interfering virtual columns. Wil lcompare with and w/o the hint.
This wil address your; "Where does the new values come from? Individual variables?" - and provide sample data.
Presently, this update pattern is used 'blindly' in that when no xml relevent changes are identified, only a couple of the roughly 16 fields are updated - yet the whole document gets updated with this update pattern. When changes occur, the whole document is updated. Will work with updating 1 or 2 fields using updatexml and try the xmlexists function for the predicate.
04/25/12 Update:
odie 63,
Here's a sample xml record from the action securefile binary xml table:
<?xml version = '1.0' encoding = 'UTF-8' standalone = 'yes'?><action xsi:type="AssessmentActionType" status_dt="2012-01-18T19:38:21.077Z" status="not applicable" create_dt="2012-01-17T23:10:16.173Z" id="dfdfdfdfdfddfdfdfdfdfdf" xmlns:ns5="http://www.xxxxx.ddd/exception/definition/schema/2010/01" xmlns="http://www.xxxxxx.ddd/mmm/domains/actions/2010/03" xmlns:ns6="http://www.xxxxx.ddd/mmm/domains/utility/outcome/2010/03" xmlns:ns7="http://www.xxxxxx.ddd/mmm/domains/common/2010/03" xmlns:ns2="http://www.xxxxx.ddd/mmm/messages/actions/2010/03" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns3="http://www.xxxxx.ddd/mmm/domains/workforce/2010/03" xmlns:ns4="http://www.xxxxxx.ddd/mmm/domains/entitlement/2011/11">
<acmeMemberId>abcdefghijklmnop</acmeMemberId>
<advocacyPlanId>qrstuvwxyz</advocacyPlanId>
<srvContextPointer>
<serviceDefUrn>urn:coderunner:Medical:Definition:ServiceService:11111:7</serviceDefUrn>
<outreachActionDefInfo sequence="1" actionDefUrn="urn:xxxxxxxxxx:Medical:Definition:Action:50813:2" actionDefId="xxxxxx">
<srvContextPath>Access Profile~Why did you access the profile?~Reason for access?</srvContextPath>
</outreachActionDefInfo>
</srvContextPointer>
</action>Started out using this update statement against the virtual column a.actn_id. This column is also indexed as a fbi.
UPDATE /*+ NO_XML_DML_REWRITE */ action A
SET A.object_value = updatexml(A.object_value,'/action/@status','triggered','xmlns="http://www.xxxx.vvv/yyy/domains/actions/2010/03"')
where a.actn_id='888a80be-d69f-464d-b3f7-85b6209f918e';
This statment updates fine with and w/o the hint. This hint takes away the piecewise update of the xml document and relies upon the a.actn_id virtual column.
Then removed the reliance on the virtual column using the xmlexists fn.
First did an alter index 'actn_id_pk invisible' to take the virtual column out of consideration by the optimizer.
UPDATE /*+ NO_XML_DML_REWRITE */ action A
SET A.object_value = updatexml(A.object_value,'/action/@status','triggered','xmlns="http://www.xxxx.vvv/yyy/domains/actions/2010/03"')
where xmlexists('$p/action[@id="'888a80be-d69f-464d-b3f7-85b6209f918e'"]' PASSING object_value as "p");
This update runs but doesn't update any columns - with or without the hint.
Also created a basic unstructured xmlindex to remove the full table scan - which worked fine execution plan-wise.
create index action_xmlindex_ix on action (object_value) indextype is xdb.xmlindex;Per the SR on this, the /*+ NO_XML_DML_REWRITE */ disables piecewise update and is a workaround for the bug surrounding virtual column index usage when having many concurrent sessions and updates against a table with millions of xml documents. Getting rid of the virtual column in the predicate removes the need for the workaround hint.
My problem is This update runs but doesn't update any columns. Maybe am missing something or doing a syntax/semantic error ?
Any assistance much appreciated...
Regards,
Rick Blanchard
Edited by: RickBlanchardSRSCigna on Apr 25, 2012 12:52 PM -
JDBC Sender Adapter - Transaction & Parameterized Query?
Dear Experts,
I'm curious about the JDBC sender adapter in SAP PI.
As I see from the document and have been searching in the Internet, The default procedure of the sender JDBC adapter is to first run a SELECT/Store Procedure query then update the records that have been read before.
Configuring the Sender JDBC Adapter - Advanced Adapter Engine - SAP Library
What I want to ask is:
- What is the database transaction used for the SELECT and the UPDATE? I mean what if the SELECT is successful and the records have been sent to the IE, but the UPDATE failed. This way, the next polling run, the same records could be read again. Is it possible? Are the SELECT and UPDATE query atomic (if one fails the other fails too)?
- Is it possible to have a parameterized query / stored procedure in sender JDBC adapter? Because seeing at the default procedure, there should be at least a field that will be used as a flag (for example the processed field needs to be updated to '1'). Something like:
- SELECT * FROM table_a WHERE docno > $last_doc_no
$last_doc_no is a paramter or variable from PI
- EXEC sp_do_something ( $param_a, $param_b )
$param_a, $param_b are parameters or variable in PI
Thank you,
Suwandi C.Hi Suwandi,
all action to database are in one transaction and thats mean if one failed all failed.
And it is possible to have parameterized storied procedure. You sould send something like
<?xml version="1.0" encoding="UTF-8"?>
<ns0:mt_proc xmlns:ns0="http://aaaa">
<statementname>
<stProc action="EXECUTE"/>
<TABLE>PROCEDURE NAME</TABLE>
<access>
<param_in isInput="1" type="some_type">input param</param_in>
<param_out isOutput="1" type="some_type"></param_out>
</access>
</statementname>
</ns0:mt_proc> -
Update query returning in ResultSet
Hi all,
I have the following UPDATE SQL.
begin
update orders
set price = price * 1.1
where origin = 'KY'
returning product, price into ?, ?;
end;
Will the above SQL return the result in a ResultSet?
If not, how do I make it return in a ResultSet?
I'm using Java JDBC call to execute the query.
Thanks,
JudyeeDo you want the updated records in recordset or the no of records updated ??
if you want updated records then you can directly query the records from order table like
select *
from
orders
where
origin = 'KY' If you wants no of records updated then you can use
v_rows_processed := SQL%ROWCOUNT;Edited by: Gj on Dec 2, 2008 5:23 PM -
I am looking for update query in KODO 4.0. How can I use named query to update "all Companies with number fo employers less then 10" ?
I seen kodo.query.Query::updateAll method but not able to get an instance of it, because it seems to be reserved for jpa interfaces only...
any idea ?
regards
Andre TeshlerHi have found the way to issue update query:
String queryString =
"update buying.changetrackingexportentry " +
" set id_confirmedstate = " + state.getId() +
" where id_confirmedstate = " + state.getId()
+
" and id_changeexportregistration in" +
" (select id from buying.changeexportregistration where id_externalprocess=" + exportId + ")"
Query query = (Query)getJdoTemplate().execute(new QueryCallback(queryString));
((kodo.jdo.QueryImpl)query).updatePersistentAll(params);
Unfortunately at runtime this results in:
<2|false|4.0.0> kodo.jdo.DataStoreException: ORA-00900: Ungültige SQL-Anweisung
at kodo.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4092)
at kodo.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:82)
at kodo.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:66)
at kodo.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:46)
at kodo.jdbc.kernel.SQLStoreQuery$SQLExecutor.executeQuery(SQLStoreQuery.java:253)
at kodo.kernel.QueryImpl.execute(QueryImpl.java:1132)
at kodo.kernel.QueryImpl.updateInMemory(QueryImpl.java:1263)
at kodo.kernel.AbstractStoreQuery$AbstractExecutor.executeUpdate(AbstractStoreQuery.java:157)
at kodo.kernel.AbstractStoreQuery$AbstractExecutor.executeUpdate(AbstractStoreQuery.java:163)
at kodo.kernel.QueryImpl.update(QueryImpl.java:1240)
at kodo.kernel.QueryImpl.execute(QueryImpl.java:957)
at kodo.kernel.QueryImpl.updateAll(QueryImpl.java:1012)
at kodo.kernel.DelegatingQuery.updateAll(DelegatingQuery.java:865)
at kodo.jdo.QueryImpl.updatePersistentAll(QueryImpl.java:815)
at com.ottogroup.buying.infrastructure.dao.masterdatachange.jdo.ChangeTrackingExportEntryRepositoryDaoJdoImpl.updateConfirmedStateToExportedByConfirmedStateAndExportId(ChangeTrackingExportEntryRepositoryDaoJdoImpl.java:133)
at com.ottogroup.buying.sharedkernel.object.masterdatachange.changeexport.ChangeTrackingExportEntryRepositoryImpl.updateConfirmedStateToExportedByConfirmedStateAndExportId(ChangeTrackingExportEntryRepositoryImpl.java:78)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:287)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
at $Proxy161.updateConfirmedStateToExportedByConfirmedStateAndExportId(Unknown Source)
at com.ottogroup.buying.sharedkernel.service.changeexport.ChangeExportServiceImpl.export(ChangeExportServiceImpl.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:287)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
at com.ottogroup.buying.sharedkernel.object.base.error.AopMessageHandler.invoke(AopMessageHandler.java:38)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
at $Proxy168.export(Unknown Source)
at test.ottogroup.sharedkernel.object.persistence.base.ChangeExportTest.export(ChangeExportTest.java:146)
at test.ottogroup.sharedkernel.object.persistence.base.ChangeExportTest.testAll(ChangeExportTest.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
NestedThrowablesStackTrace:
java.sql.SQLException: ORA-00900: Ungültige SQL-Anweisung
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:283)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:278)
at oracle.jdbc.driver.T4C8Odscrarr.receive(T4C8Odscrarr.java:214)
at oracle.jdbc.driver.T4CCallableStatement.doDescribe(T4CCallableStatement.java:731)
at oracle.jdbc.driver.OracleStatement.describe(OracleStatement.java:3458)
at oracle.jdbc.driver.OracleResultSetMetaData.<init>(OracleResultSetMetaData.java:57)
at oracle.jdbc.driver.OracleResultSetImpl.getMetaData(OracleResultSetImpl.java:138)
at com.solarmetric.jdbc.DelegatingResultSet.getMetaData(DelegatingResultSet.java:363)
at kodo.jdbc.kernel.SQLProjectionResultObjectProvider.<init>(SQLProjectionResultObjectProvider.java:43)
at kodo.jdbc.kernel.SQLStoreQuery$SQLExecutor.executeQuery(SQLStoreQuery.java:245)
at kodo.kernel.QueryImpl.execute(QueryImpl.java:1132)
at kodo.kernel.QueryImpl.updateInMemory(QueryImpl.java:1263)
at kodo.kernel.AbstractStoreQuery$AbstractExecutor.executeUpdate(AbstractStoreQuery.java:157)
at kodo.kernel.AbstractStoreQuery$AbstractExecutor.executeUpdate(AbstractStoreQuery.java:163)
at kodo.kernel.QueryImpl.update(QueryImpl.java:1240)
at kodo.kernel.QueryImpl.execute(QueryImpl.java:957)
at kodo.kernel.QueryImpl.updateAll(QueryImpl.java:1012)
at kodo.kernel.DelegatingQuery.updateAll(DelegatingQuery.java:865)
at kodo.jdo.QueryImpl.updatePersistentAll(QueryImpl.java:815)
at com.ottogroup.buying.infrastructure.dao.masterdatachange.jdo.ChangeTrackingExportEntryRepositoryDaoJdoImpl.updateConfirmedStateToExportedByConfirmedStateAndExportId(ChangeTrackingExportEntryRepositoryDaoJdoImpl.java:133)
at com.ottogroup.buying.sharedkernel.object.masterdatachange.changeexport.ChangeTrackingExportEntryRepositoryImpl.updateConfirmedStateToExportedByConfirmedStateAndExportId(ChangeTrackingExportEntryRepositoryImpl.java:78)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:287)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
at $Proxy161.updateConfirmedStateToExportedByConfirmedStateAndExportId(Unknown Source)
at com.ottogroup.buying.sharedkernel.service.changeexport.ChangeExportServiceImpl.export(ChangeExportServiceImpl.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:287)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
at com.ottogroup.buying.sharedkernel.object.base.error.AopMessageHandler.invoke(AopMessageHandler.java:38)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
at $Proxy168.export(Unknown Source)
at test.ottogroup.sharedkernel.object.persistence.base.ChangeExportTest.export(ChangeExportTest.java:146)
at test.ottogroup.sharedkernel.object.persistence.base.ChangeExportTest.testAll(ChangeExportTest.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Can someone post an example how to use updatePersistentAll() ?
thanks
Andre Teshler -
Single Update query for multiple tables
Hiii ....
I want to update Table A and Table B in a single update query can it be possible.
it is something like i have previously done with Mysql.
e.g ..
UPDATE A, B set a.A=1, b.B=X where (id.A= id.B) and id=101.
Is it possible or how can i do it, help me out.sorry, i am posting the mysql example agin, it is something like this
e.g ..
UPDATE A, B set A.a=1, B.b=X where (A.id= B.id) and A.id=101
Maybe you are looking for
-
Notebook/5.1 Speakers/TV output via S Video HELP PLEASE
Hi I am using anAcer Aspire 690 Audio Sockets Line In Mike Headphones Audio Controller Conexant AC-Link Audio Creative SBS 580 Speakers CablesS video from Computer toScart Adaptor with Svideo [and 3 jackplugs] Play Movies from Computer - Video - No P
-
Auto update of text field on drop down change (binded to XML doc)
Hi all, I have a problem that i'm stuck with since too long and I'll be really grateful for any useful idea. Here is my issue: I have this XML: <?xml version="1.0" encoding="UTF-8"?> <ItemsList> <Product> <itemUnitPrice>
-
Can users add an attachment & save the form?
I am attempting to create a form that users can download, fill out & submit with an attachment. It appears that the only way to add an attachment is the use an online (web form). But I don't see how users can save the online (web form) prior to submi
-
Sony Compatibility ? Ram problem?
I have a Sony DCR TRV30 dig camcorder, this particular camera is not listed in Imovie's supported camera list. The Imovie website says that any camera that suppports Fire Wire comm should have no problems in importing to Imovie. So my questions are:
-
Reg: Simulate the system i/0 and user i/o
Hi all, Currently am in the process of testing the database perfomance. As per , want to simulate the system i/o and user i/o upto 30ms. Please let me know the ways. your early will be highly appreciated. Thank you Regards Krishnan