UPDATE statement and database locks
Hello everybody,
I have a problem related to an UPDATE statement. There are two applications, let say A and B.
Application A executes:
update some_table
set some_field = 'value_A',
where pk_field=1
no commit!
Application B executes:
update some_table
set some_field = 'value_B',
where pk_field=1
Now application B is locked and wait until application A executes a commit.
THIS IS A PROBLEM!
I know one way to solve this problem:
Both applications should execute "select for update nowait" before
updating a row.
Is there any other solutions? Something like "update nowait"?
thanks in advance
Dmitri Geller
DGeller (at) lhsgroup dot com
The major difference between my approach and standard "select for update nowait + update"
approach, is more information for user : who blocked his object, and when. Else , i don't see the
differences. Yep. And a Boieng 747 and bicycle is not much a difference as both are used for transporting people.
Are you against select + nowait ?No, I am for understanding transaction isolation, serialisation, ACID principles, the differences between optimistic and pessimitic locking and so on
You wrote "THE LOCK is good". OK, and what about time ?The two has NOTHING to do with one another. Not a single thing.
In real industrial systems the users cannot wait more then few seconds. But the transactions can
run much more. It isn't acceptable.If by implication you mean that I'm in the .edu environment that does not deal with "real corporate systems", I'm not.
I recently wrote a special replicator in PL/SQL. It makes extensive use of customised parallel processing (does not use PQ as it also support Oracle SE). It hits very busy tables (with far over a 1000 rows/sec transaction rate). I did not have to hack my own form of locking. Performance is excellent.
Why? Not because I am a brilliant Linus-like programming genius. Simply because I used Oracle as it has been designed to use.
Can you claim the same? Can you show me the Oracle reference material that states that you need to write your own Lock Manager? Can you show me expert opinion from recognised inviduals such as Tom Kyte, Jonathan Lewis, Gary Milsap and others that state that Oracle's concurrency controls need to be hacked like you did in order to make it work?
Can you provide me with any sound technical evidence to backup your claims that your method is better than what Oracle has built into the core of the database?
Similar Messages
-
Re: what is difference between sap locking and database locking
hi,
what is difference between sap locking and database locking. Iam locked the table mara by using lock objects.
But iam unable to unlock the mara table. I give u the coding. Please check it.
REPORT zlock .
CALL FUNCTION 'ENQUEUE_EZTEST3'
EXPORTING
MODE_MARA = 'S'
MANDT = SY-MANDT
MATNR = 'SOU-1'.
call transaction 'MM02'.
CALL FUNCTION 'DEQUEUE_EZTEST3'
EXPORTING
mode_mara = 'E'
mandt = sy-mandt
matnr = 'SOU-1'.
IF sy-subrc = 0.
WRITE: 'IT IS unlocked'.
ENDIF.Hi Paluri
Here is the difference between SAP locks and Database locks, i will try to find the solution to your code.
Regards
Ashish
Database Locks: The database system automatically sets database locks when it receives change statements (INSERT, UPDATE, MODIFY, DELETE) from a program. Database locks are physical locks on the database entries affected by these statements. You can only set a lock for an existing database entry, since the lock mechanism uses a lock flag in the entry. These flags are automatically deleted in each database commit. This means that database locks can never be set for longer than a single database LUW; in other words, a single dialog step in an R/3 application program.
Physical locks in the database system are therefore insufficient for the requirements of an R/3 transaction. Locks in the R/3 System must remain set for the duration of a whole SAP LUW, that is, over several dialog steps. They must also be capable of being handled by different work processes and even different application servers. Consequently, each lock must apply on all servers in that R/3 System.
SAP Locks:
To complement the SAP LUW concept, in which bundled database changes are made in a single database LUW, the R/3 System also contains a lock mechanism, fully independent of database locks, that allows you to set a lock that spans several dialog steps. These locks are known as SAP locks.
The SAP lock concept is based on lock objects. Lock objects allow you to set an SAP lock for an entire application object. An application object consists of one or more entries in a database table, or entries from more than one database table that are linked using foreign key relationships.
Before you can set an SAP lock in an ABAP program, you must first create a lock object in the ABAP Dictionary. -
My iPhone 4 adobe reader for iOS6 is stuck in update state and will not complete updating should I uninstall and reinstall the app?
The update process is handled entirely by iOS and unfortunately, there isn't anything the Reader can do during this process to prevent "stuck updates". Generally, we don't recommend uninstalling unless you have to because uninstalling will delete all of the PDF's in your documents!
Here are some steps that work for most users:
1. Make sure wifi and/or cellular data are turned on
2. Test to be sure your internet connection is working by opening safari and browsing to a website (like www.adobe.com).
3. Single tap the app’s icon on the home screen and it will pause the download. Now go back to the iTunes Apps store, switch to the “Updates” screen and click “Update” to resume the download.
4. If this doesn't work, go to Settings -> iTunes & App Stores and tap the Apple ID to sign-out. Restart the iPad, go back to Settings -> iTunes Apps Store and sign-in. Tap the waiting icon to update the app.
Please let me know if this helps! -
I was trying to do the 7.1.2 update and my iphone 4s got stuck on the update screen, and my lock screen button is broken. How do I reset it?
iPod: How to use the Screen Lock
-
Update / Select and readpast locks
Hi everybody,
We are running into concurrency issue with one of the applications that uses multi threading (200 threads / sec running that query (in a stored procedure)). The query with the concurrency issue is the following one:
--retrieve the oldest record that needs to be processed
select top 1 @conversation_id = conversation_id from
conversation with (rowlock) , network_carrier
with (rowlock)
where
conversation.[to] = network_carrier.full_carrier_oid and
network_code = @network_code and
process = 'R' and
process_count < 3
order by conversation_id asc
--update that record to 'processing' if it has not been grabbed by someone else since we selected it above
update conversation with (rowlock)
set process = 'S',
process_time = getdate(),
process_count = process_count +1
where
conversation_id = @conversation_id and
process = 'R'
--if the rowcount is > 0, that means we got it, so return it
if @@ROWCOUNT > 0
select * from conversation with (rowlock) where conversation_id = @conversation_id
So, in order to fix this, since we cannot change the application at this time, I was thinking of changing completely the way the query works to the following:
declare @conversation_id int
--update that record to 'processing' if it has not been grabbed by someone else since we selected it above
update conversation with (rowlock)
set process = 'S',
process_time = getdate(),
process_count = process_count +1,
@conversation_id = conversation_id
where
conversation_id = (
select top 1 conversation_id from
conversation with (readpast) , network_carrier
with (rowlock)
where
conversation.[to] = network_carrier.full_carrier_oid and
network_code = @network_code and
process = 'R' and
process_count < 3
order by conversation_id asc
select * from conversation with (rowlock) where conversation_id = @conversation_id
But even though the documentation says:
* A queue reader that uses READPAST skips past queue entries locked by other transactions to the next available queue entry, without having to wait until the other transactions release their locks.
* When specified in an UPDATE statement, READPAST is applied only when reading data to identify which records to update, regardless of where in the statement it is specified
Does this skipping include SHARED LOCKS made by selects ?
ThanksAssuming that this is inside a transaction, I would change the SELECT to:
SELECT TOP (1) @conversation_id = c.conversation_id
FROM conversation c WITH (UPDLOCK, READPAST)
WHERE EXISTS (SELECT *
FROM network_carrier nc
WHERE c.[to] = nc.full_carrier_oid
AND nc.network_code = @network_code)
AND c.process = 'R'
AND c.process_count < 3
ORDER BY c.conversation_id ASC
I had to make a complete guess in which tables the unprefixed columns are, so you may need to rearranged.
I rewrote it with EXISTS, since that is apparently the purpose of the query.
I took out the ROWLOCK, because I don't see the point with them - if SQL Server feel compelled to escalate to table locks, you have bigger problems.
As for the locking, you need UPDLOCK to reserve a row, so that multiple process cannot grab the same guy. UPDLOCK is a shared lock that only can be held by one process. That is, regaular SELECT is still possible, but no one else can take an UPDLOCK, so they
will be blocked. Or would have, if it had not been for the READPAST hint.
I prefer to have the queries separate, as it makes clear what is happening. If you use an UPDATE with a subquery, the result may not be the expected.
Erland Sommarskog, SQL Server MVP, [email protected] -
I just tried to update my iPhone 4 to 7.1 and for some strange reason the phone wouldn't update then wanted me to restore it... (Figures!) But my lock button no longer works so holding the home button and the lock button is a option I have to rule out. I have no way to repair my phone myself. What can I do?
Hello Edward
Follow the prompts on your iPhone and you will get either at your home screen like normal or get to a point of restoring from back up. The article below will give step by step for restoring from back up.
iOS: How to back up and restore your content
http://support.apple.com/kb/HT1766
Thanks for using Apple Support Communities.
Regards,
-Norm G. -
Transactions and database locks
Hi,
We use Weblogic 4.5.1 on Windows NT 4.0 with Oracle 8.0.5. Our database
isolation is set to TRANSACTION_READ_COMMITTED. I have an entity bean with
TX_REQUIRED & TRANSACTION_READ_COMMITTED settings. If my client creates a
transaction, and starts calling methods on this entity bean, is the
corresponding database row locked for the duration of the transaction? We
have concurrent SQl-plus sessions going on and we want make sure there is
no data corruption. If the row is not locked, is it ok for me to explicitly
lock it from inside my entity bean?
Thanks,
Srini.
Hi. This should have been posted to the EJB or JDBC group, but I'll take it.
This is an Oracle question. If you have a transaction as you've described,
then the behavior will be exactly as if you had multiple SQL-PLUS sessions,
and in one of them, you did:
SQL> BEGIN;
-- do what your bean would do;
SQL> COMMIT;
You can test this there. In general, you'll find that Oracle's optimistic locking
will allow any number of simutaneous transactions to access a given row
at one time. Oracle does not lock the real data while a transaction is ongoing,
instead making a copy for the client to work off of. At commit time, depending
on the isolation level semantics, some or all of the transactions may fail when
Oracle tries to update the real data from the per-session private data.
I would council against running with SERIALIZABLE mode because there
is a serious bug in Oracle, where serializable transactions may fail silently.
Details on request.
Joe
Srini wrote:
> Hi,
> We use Weblogic 4.5.1 on Windows NT 4.0 with Oracle 8.0.5. Our database
> isolation is set to TRANSACTION_READ_COMMITTED. I have an entity bean with
> TX_REQUIRED & TRANSACTION_READ_COMMITTED settings. If my client creates a
> transaction, and starts calling methods on this entity bean, is the
> corresponding database row locked for the duration of the transaction? We
> have concurrent SQl-plus sessions going on and we want make sure there is
> no data corruption. If the row is not locked, is it ok for me to explicitly
> lock it from inside my entity bean?
>
> Thanks,
> Srini.
PS: Folks: BEA WebLogic is in S.F., and now has some entry-level positions for
people who want to work with Java and E-Commerce infrastructure products. Send
resumes to [email protected]
The Weblogic Application Server from BEA
JavaWorld Editor's Choice Award: Best Web Application Server
Java Developer's Journal Editor's Choice Award: Best Web Application Server
Crossroads A-List Award: Rapid Application Development Tools for Java
Intelligent Enterprise RealWare: Best Application Using a Component Architecture
http://weblogic.beasys.com/press/awards/index.htm
-
Help with UPDATE table and database RELATIONSHIPS
HI there, I have been trying to create an update table for
weeks now and keep getting error messages.
The database has a table named:
"books" in the table cells are "idbook" and "book".
"suppliers" in the table cells are "idsupplier" and
"supplierName".
"category" in the table cells are "idcategory" and
categoryName"
They all have a relationships with this table:
"results" in the cells are "idbook", "idsupplier" and
"idcategory".
This "results" table brings all of the above tables together.
When I try to do an update, i am doing one to the results
table. Is this correct?
The updates have problems because when drawing the text to
the update table to view it comes in text form.
When trying to update, it wont becuase all of the cells in
the results table are numeric. This is because of the
relationships.
Can anyone suggest where i may be going wrong.
Ask anything you need to.
TAMM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
If (MM_editRedirectUrl <> "") Then
Response.Redirect(MM_editRedirectUrl)
End If
End If
End If
%>
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
If (Session("MM_UserName") <> "") Then
Recordset1__MMColParam = Session("MM_UserName")
End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_connSeek_STRING
Recordset1.Source = "SELECT * FROM Query1 WHERE UserName = '"
+ Replace(Recordset1__MMColParam, "'", "''") + "'"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
Dim rsUpdate
Dim rsUpdate_numRows
Set rsUpdate = Server.CreateObject("ADODB.Recordset")
rsUpdate.ActiveConnection = MM_connSeek_STRING
rsUpdate.Source = "SELECT * FROM tblSpecies"
rsUpdate.CursorType = 0
rsUpdate.CursorLocation = 2
rsUpdate.LockType = 1
rsUpdate.Open()
rsUpdate_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<html>
<head>
<link href="css%20files/paragraph.css" rel="stylesheet"
type="text/css">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new
Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0;
i<a.length; i++)
if (a
.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}}
//-->
</script>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0"
marginwidth="0" marginheight="0"
onLoad="MM_preloadImages('images/Publicationb.gif','images/Factsheetsb.gif')">
<table width="100%" height="100%" border="1"
cellpadding="0" cellspacing="0" bordercolor="#5D5D5D">
<tr>
<td colspan="2">
<div align="right"></div>
<div align="left"></div>
</td>
</tr>
<tr>
<td colspan="2"><table width="100%" height="100%"
border="0" cellpadding="0" cellspacing="0"
bordercolor="#5D5D5D">
<tr>
<td valign="top"><form
ACTION="<%=MM_editAction%>" METHOD="POST" name="form1">
<table width="90%" border="0" align="center"
cellpadding="0" cellspacing="0">
<tr>
<td valign="top"><div
align="center"></div> <table border="1" align="center"
cellpadding="2" cellspacing="0" bordercolor="#FFFFFF">
<tr bgcolor="ECECD7">
<td colspan="2"><div align="center">
<p><strong><font size="3">Update Key Word
& Category</font></strong></p>
</div>
</td>
</tr>
<tr>
<td><div align="center">
<p><font size="1">Enter Up to 10 Species /
Product
Name</font></p>
</div>
</td>
<td><div align="center">
<p><font size="1">Select a
Category</font></p>
</div>
</td>
</tr>
<tr>
<td colspan="2" bordercolor="#D0D09D">
<%
While ((Repeat1__numRows <> 0) AND (NOT
Recordset1.EOF))
%>
<table width="100%" border="0" cellspacing="0"
cellpadding="0">
<tr><td width="50%"><div align="center">
<input name="f1" type="text" id="f13"
value="<%=(Recordset1.Fields.Item("TimberSpecies").Value)%>"
size="33">
</div></td>
<td width="45%"><div
align="center"></div></td></tr></table>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend %>
<div align="center"> </div> <div
align="center">
</div></td></tr><tr>td
colspan="2"> </td></tr><tr><td
colspan="2"><div align="right"><p><font
size="1">To Finalise Your Changes Please Press the Update
Button
<input name="update2" type="submit" id="update"
value="Update">
<input type="hidden" name="MM_update" value="form1">
<input type="hidden" name="MM_recordId" value="<%=
rsUpdate.Fields.Item("TimberSpecies").Value %>"> -
Db13 both the jobs failed update stats and DB check
Dear Friends,
Request you to look at following logs and suggest .
Thanks in advance.
BR0883I Table selected to collect statistics after check: SAPSR3.ALSLDCTRL (1/0:34:0)
BR0280I BRCONNECT time stamp: 2009-07-20 23.00.50
BR0881I Collecting statistics for table SAPSR3.ALSLDCTRL with method/sample C ...
BR0280I BRCONNECT time stamp: 2009-07-20 23.00.50
BR0884I Statistics collected for table: SAPSR3.ALSLDCTRL, rows old/new: 1/1
BR0280I BRCONNECT time stamp: 2009-07-20 23.00.50
BR0883I Table selected to collect statistics after check: SAPSR3.ALTSTLOD (118/0:6940:0)
BR0280I BRCONNECT time stamp: 2009-07-20 23.00.50
BR0881I Collecting statistics for table SAPSR3.ALTSTLOD with method/sample C ...
BR0280I BRCONNECT time stamp: 2009-07-20 23.00.50
BR0884I Statistics collected for table: SAPSR3.ALTSTLOD, rows old/new: 118/118
BR0280I BRCONNECT time stamp: 2009-07-20 23.00.50
BR0850I 9 of 102 objects processed - 0.105 of 9.323 units done
BR0204I Percentage done: 1.12%, estimated end time: 23:11
BR0001I *_________________________________________________
BR0280I BRCONNECT time stamp: 2009-07-20 23.00.50
BR0883I Table selected to collect statistics after check: SAPSR3.ARFCRSTATE (43/29218:7005:29195)
BR0280I BRCONNECT time stamp: 2009-07-20 23.00.50
BR0881I Collecting statistics for table SAPSR3.ARFCRSTATE with method/sample C ...
BR0280I BRCONNECT time stamp: 2009-07-20 23.00.53
BR0884I Statistics collected for table: SAPSR3.ARFCRSTATE, rows old/new: 43/66
BR0280I BRCONNECT time stamp: 2009-07-20 23.00.53
BR0883I Table selected to collect statistics after check: SAPSR3.ARFCSDATA (153830/419010:0:296422)
BR0280I BRCONNECT time stamp: 2009-07-20 23.00.53
BR0881I Collecting statistics for table SAPSR3.ARFCSDATA with method/sample E/P10 ...
BR0280I BRCONNECT time stamp: 2009-07-20 23.01.12
BR0884I Statistics collected for table: SAPSR3.ARFCSDATA, rows old/new: 153830/274700
BR0280I BRCONNECT time stamp: 2009-07-20 23.01.12
BR0850I 11 of 102 objects processed - 0.550 of 9.323 units done
BR0204I Percentage done: 5.90%, estimated end time: 23:08
BR0001I ***_______________________________________________
BR0280I BRCONNECT time stamp: 2009-07-20 23.01.12
BR0301W SQL error -1 at location brc_dblog_write-2, SQL statement:
'INSERT INTO SAP_SDBAD (BEG, FUNCT, SYSID, POS, LINE) VALUES ('20090720230019', 'sta', 'WIP', '0000', 'A 00000000 00000000 00000
ORA-00001: unique constraint (SAPSR3DB.SDBAD__0) violated
BR0325W Writing to database log failed
BR0280I BRCONNECT time stamp: 2009-07-20 23.01.12
BR0883I Table selected to collect statistics after check: SAPSR3.ARFCSSTATE (4029/146985:38657:32482)
BR0280I BRCONNECT time stamp: 2009-07-20 23.01.12
BR0881I Collecting statistics for table SAPSR3.ARFCSSTATE with method/sample E/P10 ...
BR0280I BRCONNECT time stamp: 2009-07-20 23.01.27
BR0884I Statistics collected for table: SAPSR3.ARFCSSTATE, rows old/new: 4029/119330
BR0280I BRCONNECT time stamp: 2009-07-20 23.01.27
BR0883I Table selected to collect statistics after check: SAPSR3.BAL_AMODAL (0/70:0:70)
BR0280I BRCONNECT time stamp: 2009-07-20 23.01.27
BR0881I Collecting statistics for table SAPSR3.BAL_AMODAL with method/sample C ...
BR2.16
20.07.2009 23:12:50 BR0884I Statistics collected for table: SAPSR3.TSP02, rows old/new: 23263/24250
20.07.2009 23:12:50 BR0280I BRCONNECT time stamp: 2009-07-20 23.12.16
20.07.2009 23:12:50 BR0883I Table selected to collect statistics after check: SAPSR3.TSP02FX (1511/9606:0:9600)
20.07.2009 23:12:50 BR0280I BRCONNECT time stamp: 2009-07-20 23.12.16
20.07.2009 23:12:50 BR0881I Collecting statistics for table SAPSR3.TSP02FX with method/sample C ...
20.07.2009 23:12:50 BR0280I BRCONNECT time stamp: 2009-07-20 23.12.16
20.07.2009 23:12:50 BR0884I Statistics collected for table: SAPSR3.TSP02FX, rows old/new: 1511/1517
20.07.2009 23:12:50 BR0280I BRCONNECT time stamp: 2009-07-20 23.12.16
20.07.2009 23:12:50 BR0883I Table selected to collect statistics after check: SAPSR3.TSP02W (1511/9606:0:9600)
20.07.2009 23:12:50 BR0280I BRCONNECT time stamp: 2009-07-20 23.12.16
20.07.2009 23:12:50 BR0881I Collecting statistics for table SAPSR3.TSP02W with method/sample C ...
20.07.2009 23:12:50 BR0280I BRCONNECT time stamp: 2009-07-20 23.12.16
20.07.2009 23:12:50 BR0884I Statistics collected for table: SAPSR3.TSP02W, rows old/new: 1511/1517
20.07.2009 23:12:50 BR0280I BRCONNECT time stamp: 2009-07-20 23.12.16
20.07.2009 23:12:50 BR0883I Table selected to collect statistics after check: SAPSR3.TSPOPTIONS (12/0:10970:0)
20.07.2009 23:12:50 BR0280I BRCONNECT time stamp: 2009-07-20 23.12.16
20.07.2009 23:12:50 BR0881I Collecting statistics for table SAPSR3.TSPOPTIONS with method/sample C ...
20.07.2009 23:12:50 BR0280I BRCONNECT time stamp: 2009-07-20 23.12.17
20.07.2009 23:12:50 BR0884I Statistics collected for table: SAPSR3.TSPOPTIONS, rows old/new: 12/12
20.07.2009 23:12:50 BR0280I BRCONNECT time stamp: 2009-07-20 23.12.17
20.07.2009 23:12:50 BR0883I Table selected to collect statistics after check: SAPSR3.TSPSVI (5/0:19210:0)
20.07.2009 23:12:50 BR0280I BRCONNECT time stamp: 2009-07-20 23.12.17
20.07.2009 23:12:50 BR0881I Collecting statistics for table SAPSR3.TSPSVI with method/sample C ...
20.07.2009 23:12:50 BR0280I BRCONNECT time stamp: 2009-07-20 23.12.17
20.07.2009 23:12:50 BR0884I Statistics collected for table: SAPSR3.TSPSVI, rows old/new: 5/5
20.07.2009 23:12:50 BR0280I BRCONNECT time stamp: 2009-07-20 23.12.17
20.07.2009 23:12:50 BR0883I Table selected to collect statistics after check: SAPSR3.TST01 (31843/15941:56883:15606)
20.07.2009 23:12:50 BR0280I BRCONNECT time stamp: 2009-07-20 23.12.17
20.07.2009 23:12:50 BR0881I Collecting statistics for table SAPSR3.TST01 with method/sample E/P30 ...
20.07.2009 23:12:50 BR0280I BRCONNECT time stamp: 2009-07-20 23.12.19
20.07.2009 23:12:50 BR0884I Statistics collected for table: SAPSR3.TST01, rows old/new: 31843/31640
20.07.2009 23:12:50 BR0280I BRCONNECT time stamp: 2009-07-20 23.12.19
20.07.2009 23:12:50 BR0883I Table selected to collect statistics after check: SAPSR3.TUCNTRAW (63/83:16833:91)
20.07.2009 23:12:50 BR0280I BRCONNECT time stamp: 2009-07-20 23.12.19
20.07.2009 23:12:50 BR0881I Collecting statistics for table SAPSR3.TUCNTRAW with method/sample C ...
20.07.2009 23:12:50 BR0280I BRCONNECT time stamp: 2009-07-20 23.12.19
20.07.2009 23:12:50 BR0884I Statistics collected for table: SAPSR3.TUCNTRAW, rows old/new: 63/55
20.07.2009 23:12:50 BR0280I BRCONNECT time stamp: 2009-07-20 23.12.19
20.07.200 for table: SAPSR3.ZWS_POSTING_DATE, rows old/new: 582110/578840
20.07.2009 23:12:50 BR0280I BRCONNECT time stamp: 2009-07-20 23.12.49
20.07.2009 23:12:50 BR0883I Table selected to collect statistics after check: SAPSR3DB.BC_UDDI_PARAM (82/320:4:320)
20.07.2009 23:12:50 BR0280I BRCONNECT time stamp: 2009-07-20 23.12.49
20.07.2009 23:12:50 BR0881I Collecting statistics for table SAPSR3DB.BC_UDDI_PARAM with method/sample C ...
20.07.2009 23:12:50 BR0280I BRCONNECT time stamp: 2009-07-20 23.12.49
20.07.2009 23:12:50 BR0884I Statistics collected for table: SAPSR3DB.BC_UDDI_PARAM, rows old/new: 82/82
20.07.2009 23:12:50 BR0280I BRCONNECT time stamp: 2009-07-20 23.12.49
20.07.2009 23:12:50 BR0883I Table selected to collect statistics after check: SAPSR3DB.J2EE_KEYSEQUENCE (1/0:8:0)
20.07.2009 23:12:50 BR0280I BRCONNECT time stamp: 2009-07-20 23.12.49
20.07.2009 23:12:50 BR0881I Collecting statistics for table SAPSR3DB.J2EE_KEYSEQUENCE with method/sample C ...
20.07.2009 23:12:50 BR0280I BRCONNECT time stamp: 2009-07-20 23.12.49
20.07.2009 23:12:50 BR0884I Statistics collected for table: SAPSR3DB.J2EE_KEYSEQUENCE, rows old/new: 1/1
20.07.2009 23:12:50
20.07.2009 23:12:50 BR0280I BRCONNECT time stamp: 2009-07-20 23.12.49
20.07.2009 23:12:50 BR0850I 102 of 102 objects processed - 9.323 of 9.323 units done
20.07.2009 23:12:50 BR0204I Percentage done: 100.00%, estimated end time: 23:12
20.07.2009 23:12:50 BR0001I **************************************************
20.07.2009 23:12:50 BR0280I BRCONNECT time stamp: 2009-07-20 23.12.49
20.07.2009 23:12:50 BR0301W SQL error -1 at location brc_dblog_write-2, SQL statement:
20.07.2009 23:12:50 'INSERT INTO SAP_SDBAD (BEG, FUNCT, SYSID, POS, LINE) VALUES ('20090720230019', 'sta', 'WIP', '0000', 'A 00000000 00000000 00000
20.07.2009 23:12:50 ORA-00001: unique constraint (SAPSR3DB.SDBAD__0) violated
20.07.2009 23:12:50 BR0325W Writing to database log failed
20.07.2009 23:12:50
20.07.2009 23:12:50 BR0280I BRCONNECT time stamp: 2009-07-20 23.12.49
20.07.2009 23:12:50 BR0879I Statistics checked for 68351 tables
20.07.2009 23:12:50 BR0878I Number of tables selected to collect statistics after check: 102
20.07.2009 23:12:50 BR0880I Statistics collected for 102/0 tables/indexes
20.07.2009 23:12:50 BR0280I BRCONNECT time stamp: 2009-07-20 23.12.49
20.07.2009 23:12:50 BR0301W SQL error -1 at location brc_dblog_write-2, SQL statement:
20.07.2009 23:12:50 'INSERT INTO SAP_SDBAD (BEG, FUNCT, SYSID, POS, LINE) VALUES ('20090720230019', 'sta', 'WIP', '0000', 'A 00000000 00000000 00000
20.07.2009 23:12:50 ORA-00001: unique constraint (SAPSR3DB.SDBAD__0) violated
20.07.2009 23:12:50 BR0325W Writing to database log failed
20.07.2009 23:12:50
20.07.2009 23:12:50 BR0806I End of BRCONNECT processing: cebbggbz.sta2009-07-20 23.12.49
20.07.2009 23:12:50 BR0280I BRCONNECT time stamp: 2009-07-20 23.12.49
20.07.2009 23:12:50 BR0803I BRCONNECT completed successfully with warnings
20.07.2009 23:12:50 External program terminated with exit code 1
20.07.2009 23:12:50 BRCONNECT returned error status E
20.07.2009 23:12:50 Job finishedHi Jiggi
Are you running 2 jobs at the same time from DB13? What do you mean by >Db13 both the jobs failed
>ORA-00001: unique constraint
can happen due to lot of reasons in SAP. Basically it means you are insertion of already existing records.
This also may happen due to bug in brtools patch level. What is your brtools patch level?
You can also have a look at
https://service.sap.com/sap/support/notes/421697
https://service.sap.com/sap/support/notes/458872
Anindya -
I can't access the App Store app. When I tap the Icon, a large Delta airlines app is superimposed over the top of everything and freezes up the entire App Store. how can delete this large app and where did it come from.
Quit the App Store app and reset your iPad.
Double click the Home button to show the screen with running and recently used apps. Each app icon will have a sample page above it. Flick up on the page (not the app icon) and the page will fly away and the app icon will disappear. This quits that app. Then reset your device. Press and hold the Home and Sleep buttons simultaneously until the Apple logo appears. Let go of the buttons and let the device restart. See if that fixes your problem. -
Updating policies and Policy Database or Policy Updates without server restart
Hi again,
I have implemented the flash access reference implementation server including setting up all example database tables (so we have a central database server). I have started updating policies for the application "whitelist" features and have run into some questions below.
The Protecting Content documentation states:
"If your license server has access to a database for storing policies, you can retrieve the updated policy from the database and call LicenseRequestMessage.setSelectedPolicy()"
This leads to two questions:
1) The reference implementation doesn't store any Policies in the database (it stores them on the filesystem in the Resources Directory). I can not find any documentation or examples of how to "retrieve the updated policy from the database". Can somebody please point me to an example or documentation on how to store policies in the database so I can simply LicenseRequestMessage.setSelectedPolicy()?
2) As the reference implementation stores policies on the disk I had to use policy update lists when I whitelisted an AIR app. However, the reference server did not honor the policy update list till I restarted the flash access reference server. How can I notify the flash access server of the change to the update policy list without restarting the server?
Thank you,
-RHello,
Please see my answers below.
Answer 1>
If you want to store the binary representation of the policy in the database, you can invoke Policy.getBytes() and store the returned byte[] as a blob in the database. For details on how to store such binary data in a database, you should consult the documentation for you database. Then, to rebuild a policy that had been stored in a database, you can obtain the byte[] stored in the database, and invoke new Policy(byte[]) with it to reconstruct that policy instance.
See the following javadocs:
* Retrieves an encoded byte array representation of the policy.
* <p>If this <code>Policy</code> was created from an empty constructor, the revision number
* will be <code>1</code>. If this was an existing policy and changes were made to the policy,
* the revision number will be incremented by one. Otherwise, the revision number will not change.</p>
* <p>The validity of the policy is first checked before encoding into a byte array. Encoding will fail
* if {@link #checkValidity()} throws an exception.</p>
* @return A serialized representation of the policy.
* @throws PolicyModificationException The <code>Policy</code> cannot be serialized because it was created with a newer version and was modified.
* @throws PolicyException The <code>Policy</code> is missing required fields or contains conflicting entries.
* @throws EncodingException Unable to encode the <code>Policy</code> to a byte array.
public byte[] getBytes() throws PolicyException, EncodingException;
* This constructor parses an existing policy from the given byte array.
* @param policy The policy from which to construct this <code>Policy</code>.
* @throws EncodingException Unable to parse the byte array into a <code>Policy</code>.
* @throws PolicyException The <code>Policy</code> is missing required fields or contains conflicting entries.
public Policy( byte[] policy ) throws PolicyException, EncodingException;
Answer 2>
In order to implement automatic configuration updates of policy update lists on the flash access server, you will need to tweak the Reference Implementation code, to monitor the file update state and re-load the PolicyUpdateList if it changes. The code snippet below, taken from the com.adobe.flashaccess.refimpl.util.ParamsReader.buildHandlerConfiguration() method, should serve as an example of how the PolicyUpdateList is loaded and then set on the HandlerConfiguration instance for it to take effect for a particular license acquisition request. In the case of the reference implementation, this code (below) is only invoked once, during server initialization. That is why a server restart is necessary for subsequent changes to take effect. However, nothing prevents this code form being invoked elsewhere, and that implementation is entirely upto the customer, to achieve the desired outcome.
PolicyUpdateList pul = PolicyUpdateListFactory.loadPolicyUpdateList(pulInputStream);
if (pul != null)
X509Certificate issuerCert = null;
if (hsmEnabled)
issuerCert = getHSMCertificate(props, hsmUtils, "RevocationList.verifySignature.X509Certificate");
else
String pulSignatureCertFile = props.getProperty("RevocationList.verifySignature.X509Certificate");
if (pulSignatureCertFile != null)
InputStream pulSignerInputStream = new FileInputStream(resourcesDir + pulSignatureCertFile);
issuerCert = CertificateFactory.loadCert(pulSignerInputStream);
if (issuerCert != null)
pul.verifySignature(issuerCert);
context.setPolicyUpdateList(pul);
Regards,
Safdar -
Hi all,
I have developed web application by oracle forms and connected with oracle 10g database.
Sometimes, User advised get notification to retry when edit record due to another user edited same record before but no commit.
can u help me that how to control ideal locking of database or config better than above for above situation ?
Besides, 11gR2 have new feature to enhance database locking ? How to do ?
tks a lot
Best Regards
Borisborisys wrote:
I have developed web application by oracle forms and connected with oracle 10g database.
Sometimes, User advised get notification to retry when edit record due to another user edited same record before but no commit.A web application has stateless clients. This means that no client state exists in the database for the client. Therefore default database locking (called pessimistic locking) cannot be used.
You need to instead manually implement optimistic locking.
This means that rows are not locked in the database (using pessimistic db locks). Before an update of a row, the existing row needs to be checked against the original row that the web client has updated. If the database row is still the same, it means that the update can go ahead. If it is different, it means that another session has changed the row in the meantime.
There are a number of methods to use to implement optimistic locking - depending on the structure of the data and features of the database.
Keep in mind that this is not a database issue. The database supports locking just fine. But the clients do not as the clients have no state and thus locks cannot persist for the duration of that client's interaction with the database. With a web client, each and every time the client issues database requests, these are seen as brand new sessions and brand new requests by the database.
Optimistic locking is implemented in the application layer. Pessimistic locking exists in the database layer. -
Sudden increase in buffer gets per executions in update statement
Hi,
Recently we have encountered one performance issue, which is most likely caused by a sudden increase in the buffer gets per execution.
The SQL is an update statement, updating a table using a primary key (we have checked to confirm the running execution plan is using the primary key), and one field being updated is a BLOB column.
As shown in the below statistics, there is no major change in the number of executions during the every 20 minutes monitoring interval. However, the buffer gets per executions has been more than double, and the CPU time is almost doubled, hence the exec_time (elapsed time) has been doubled.
The same SQL has been running for the past four years in multiple similar databases. The database is Oracle 9.2.0.4 running on Solaris 9. For the past 300 days, the average elapsed time per execution is about 0.0093s, while the average buffer gets per execution is about 670. The update statement has been executed about 9 times per second.
The question is why there is a sudden increase in the buffer gets? The sudden increase happened twice for the past two days.
<pre>
B_TIME E_TIME EXECUTIONS_DIFF EXEC_TIME CPU_TIME BUFFER_GETS EXEC_PER_DAY
2009-11-25-14:04 2009-11-25-14:23 8513 .0069 .0068 315.56 646329
2009-11-25-14:23 2009-11-25-14:43 10170 .007 .0068 312.28 726188
2009-11-25-14:43 2009-11-25-15:05 11873 .0072 .0069 320.17 787885
2009-11-25-15:05 2009-11-25-15:23 8633 .011 .0101 844.83 675014
2009-11-25-15:23 2009-11-25-15:44 9668 .0144 .0137 1448.51 680778
2009-11-25-15:44 2009-11-25-16:04 9671 .0163 .0156 1809.04 702163
2009-11-25-16:04 2009-11-25-16:25 10260 .0188 .0177 2107.67 711447
2009-11-25-16:25 2009-11-25-16:44 9827 .0157 .0151 1834.3 739593
2009-11-25-16:44 2009-11-25-17:05 10586 .0171 .0164 2008.25 714555
2009-11-26-08:04 2009-11-26-08:24 11028 .0182 .0172 1979.61 800688
2009-11-26-08:24 2009-11-26-08:44 10533 .0154 .0149 1734.62 750248
2009-11-26-08:44 2009-11-26-09:04 9367 .018 .0168 2043.95 685274
2009-11-26-09:04 2009-11-26-09:24 10307 .0214 .0201 2552.43 729938
2009-11-26-09:24 2009-11-26-09:45 10932 .0251 .0234 3111.48 762328
2009-11-26-09:45 2009-11-26-10:05 10992 .0278 .0254 3386.41 797404
2009-11-26-15:03 2009-11-26-15:16 7183 .0425 .0348 4615.42 746824
2009-11-26-15:16 2009-11-26-15:23 2921 .0417 .0373 4887.75 682092
2009-11-26-15:23 2009-11-26-15:43 9597 .0393 .0352 4603.62 679656
2009-11-26-15:43 2009-11-26-16:03 8797 .0411 .0362 4783.66 630755
2009-11-26-16:03 2009-11-26-16:23 9957 .0453 .0391 5168.28 718100
2009-11-26-16:23 2009-11-26-16:43 11209 .0436 .0369 4870.77 808395
2009-11-26-16:43 2009-11-26-17:03 10729 .0428 .0375 5119.56 766103
2009-11-26-17:03 2009-11-26-17:23 9116 .0409 .0363 4912.58 659098
</pre>
Yesterday I did a trace on one of the sessions running the update statement, and below is the tkprof output:
<pre>
call count cpu elapsed disk query current rows
Parse 76 0.03 0.00 0 0 0 0
Execute 76 4.58 5.14 0 567843 19034 76
Fetch 0 0.00 0.00 0 0 0 0
total 152 4.61 5.14 0 567843 19034 76
Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: 88
Rows Row Source Operation
1 UPDATE (cr=30 r=0 w=0 time=6232 us)
1 INDEX UNIQUE SCAN <PK Index Name> (cr=3 r=0 w=0 time=58 us)(object id 81122)
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
Waited--------------------------------------------------------------------------------
SQL*Net message to client 152 0.00 0.00
SQL*Net message from client 152 0.00 0.22
SQL*Net more data from client 1894 0.00 0.03
SQL*Net break/reset to client 152 0.00 0.00
buffer busy waits 14 0.00 0.00
enqueue 1 0.61 0.61
</pre>
GaoYuanHi,
I've reformatted your output for better understanding (with {noformat}...{noformat}):
B_TIME E_TIME EXECUTIONS_DIFF EXEC_TIME CPU_TIME BUFFER_GETS EXEC_PER_DAY
2009-11-25-14:04 2009-11-25-14:23 8513 .0069 .0068 315.56 646329
2009-11-25-14:23 2009-11-25-14:43 10170 .007 .0068 312.28 726188
2009-11-25-14:43 2009-11-25-15:05 11873 .0072 .0069 320.17 787885
2009-11-25-15:05 2009-11-25-15:23 8633 .011 .0101 844.83 675014
2009-11-25-15:23 2009-11-25-15:44 9668 .0144 .0137 1448.51 680778
2009-11-25-15:44 2009-11-25-16:04 9671 .0163 .0156 1809.04 702163
2009-11-25-16:04 2009-11-25-16:25 10260 .0188 .0177 2107.67 711447
2009-11-25-16:25 2009-11-25-16:44 9827 .0157 .0151 1834.3 739593
2009-11-25-16:44 2009-11-25-17:05 10586 .0171 .0164 2008.25 714555
2009-11-26-08:04 2009-11-26-08:24 11028 .0182 .0172 1979.61 800688
2009-11-26-08:24 2009-11-26-08:44 10533 .0154 .0149 1734.62 750248
2009-11-26-08:44 2009-11-26-09:04 9367 .018 .0168 2043.95 685274
2009-11-26-09:04 2009-11-26-09:24 10307 .0214 .0201 2552.43 729938
2009-11-26-09:24 2009-11-26-09:45 10932 .0251 .0234 3111.48 762328
2009-11-26-09:45 2009-11-26-10:05 10992 .0278 .0254 3386.41 797404
2009-11-26-15:03 2009-11-26-15:16 7183 .0425 .0348 4615.42 746824
2009-11-26-15:16 2009-11-26-15:23 2921 .0417 .0373 4887.75 682092
2009-11-26-15:23 2009-11-26-15:43 9597 .0393 .0352 4603.62 679656
2009-11-26-15:43 2009-11-26-16:03 8797 .0411 .0362 4783.66 630755
2009-11-26-16:03 2009-11-26-16:23 9957 .0453 .0391 5168.28 718100
2009-11-26-16:23 2009-11-26-16:43 11209 .0436 .0369 4870.77 808395
2009-11-26-16:43 2009-11-26-17:03 10729 .0428 .0375 5119.56 766103
2009-11-26-17:03 2009-11-26-17:23 9116 .0409 .0363 4912.58 659098
call count cpu elapsed disk query current rows
Parse 76 0.03 0.00 0 0 0 0
Execute 76 4.58 5.14 0 567843 19034 76
Fetch 0 0.00 0.00 0 0 0 0
total 152 4.61 5.14 0 567843 19034 76
Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: 88
Rows Row Source Operation
1 UPDATE (cr=30 r=0 w=0 time=6232 us)
1 INDEX UNIQUE SCAN <PK Index Name(cr=3 r=0 w=0 time=58 us)(object id 81122)
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
SQL*Net message to client 152 0.00 0.00
SQL*Net message from client 152 0.00 0.22
SQL*Net more data from client 1894 0.00 0.03
SQL*Net break/reset to client 152 0.00 0.00
buffer busy waits 14 0.00 0.00
enqueue 1 0.61 0.61
********************************************************************************Can you please provide a DDL for the table, indexes, type of the tablespace(s) they reside in (ASSM/MSSM, extents sizes), the UPDATE statement, how many sessions on average/peaks are doing the same thing concurrently, how many sessions are working this table concurrently and how do they use it? -
Help needed with Update statements.
Hello All,
I am trying to learn Berkeley XMLDB and facing problem to query the inserted XML file. I have a small XML file with the following contents:
<?xml version="1.0" standalone="yes"?>
<Bookstore>
<Book>
<book_ID>1</book_ID>
<title>Harry Potter and the Order of the Phoenix</title>
<subtitle>A Photographic History</subtitle>
<author>
<author_fname>J.K.</author_fname>
<author_lname>Rowling</author_lname>
</author>
<price>9.99</price>
<year_published>2004</year_published>
<publisher>Scholastic, Inc.</publisher>
<genre>Fiction</genre>
<quantity_in_stock>28997</quantity_in_stock>
<popularity>20564</popularity>
</Book>
</Bookstore>
When I try to update the TITLE of this node I have the following error message:
C:\Users\Chandra\Desktop\BDB>javac -classpath .;"C:\Program Files\Sleepycat Soft
ware\Berkeley DB XML 2.1.8\jar\dbxml.jar";"C:\Program Files\Sleepycat Software\B
erkeley DB XML 2.1.8\jar\db.jar" bdb.java
bdb.java:75: illegal start of expression
public static final String STATEMENT1 = "replace value of node collection("twopp
ro.bdbxml")/Bookstore/Book/bookid/title with 'NEWBOOK'";
^
bdb.java:80: ')' expected
System.out.println("Done query: " + STATEMENT1);
^
2 errors
But when I remove the update statements and just try to display the TITLE of this node, I dont see any outputs. Please help me to catch up with my mistakes. Below is source code I am using to run this functionality.
Thanks.
import java.io.File;
import java.io.FileNotFoundException;
import com.sleepycat.db.DatabaseException;
import com.sleepycat.db.Environment;
import com.sleepycat.db.EnvironmentConfig;
import com.sleepycat.dbxml.XmlContainer;
import com.sleepycat.dbxml.XmlException;
import com.sleepycat.dbxml.XmlInputStream;
import com.sleepycat.dbxml.XmlManager;
import com.sleepycat.dbxml.XmlUpdateContext;
import com.sleepycat.dbxml.XmlDocument;
import com.sleepycat.dbxml.XmlQueryContext;
import com.sleepycat.dbxml.XmlQueryExpression;
import com.sleepycat.dbxml.XmlResults;
import com.sleepycat.dbxml.XmlValue;
public class bdb{
public static void main(String[] args)
Environment myEnv = null;
File envHome = new File("D:/xmldata");
try {
EnvironmentConfig envConf = new EnvironmentConfig();
envConf.setAllowCreate(true); // If the environment does not
// exits, create it.
envConf.setInitializeCache(true); // Turn on the shared memory
// region.
envConf.setInitializeLocking(true); // Turn on the locking subsystem.
envConf.setInitializeLogging(true); // Turn on the logging subsystem.
envConf.setTransactional(true); // Turn on the transactional
envConf.setRunRecovery(true);
// subsystem.
myEnv = new Environment(envHome, envConf);
// Do BDB XML work here.
} catch (DatabaseException de) {
// Exception handling goes here
} catch (FileNotFoundException fnfe) {
// Exception handling goes here
} finally {
try {
if (myEnv != null) {
myEnv.close();
} catch (DatabaseException de) {
// Exception handling goes here
XmlManager myManager = null;
XmlContainer myContainer = null;
// The document
String docString = "D:/xmldata/test.xml";
// The document's name.
String docName = "cia";
try {
myManager = new XmlManager(); // Assumes the container currently exists.
myContainer =
myManager.createContainer("twoppro.bdbxml");
myManager.setDefaultContainerType(XmlContainer.NodeContainer); // Need an update context for the put.
XmlUpdateContext theContext = myManager.createUpdateContext(); // Get the input stream.
XmlInputStream theStream =
myManager.createLocalFileInputStream(docString); // Do the actual put
myContainer.putDocument(docName, // The document's name
theStream, // The actual document.
theContext, // The update context
// (required).
null); // XmlDocumentConfig object
theStream.delete();
// Update the title
public static final String STATEMENT1 = "*replace value of node collection("twoppro.bdbxml")/Bookstore/Book/[bookid=1]/title with 'NEWBOOK'";*
XmlQueryContext context = myManager.createQueryContext();
XmlQueryExpression queryExpression1 = myManager.prepare(STATEMENT1, context);
System.out.println("Try to execute query: " +
System.out.println("Done query: " + STATEMENT1);
queryExpression1.execute(context);
// Get a query context
XmlQueryContext context = myManager.createQueryContext();
// Set the evaluation type to Lazy.
context.setEvaluationType(XmlQueryContext.Lazy);
// Declare the query string
String queryString =
"for $u in collection('twoppro.dbxml')/Bookstore/Book/[bookid=1]"
+ "*return $u/title";*
// Prepare (compile) the query
XmlQueryExpression qe = myManager.prepare(queryString, context);
XmlResults results = qe.execute(context);
System.out.println("ok");
System.out.println(results);
} catch (XmlException e) {
// Error handling goes here. You may want to check
// for XmlException.UNIQUE_ERROR, which is raised
// if a document with that name already exists in
// the container. If this exception is thrown,
// try the put again with a different name, or
// use XmlModify to update the document.
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally {
try {
if (myContainer != null) {
myContainer.close();
if (myManager != null) {
myManager.close();
} catch (XmlException ce) {
// Exception handling goes hereThanks Rucong. The change you suggested did helped me to run the program correct. But I also have the display function to retrive the results and my program is parsed without any output.
C:\Users\C\Desktop\BDB>Clientbuild.bat
C:\Users\C\Desktop\BDB>javac -classpath .;"C:\Program Files\Sleepycat Soft
ware\Berkeley DB XML 2.1.8\jar\dbxml.jar";"C:\Program Files\Sleepycat Software\B
erkeley DB XML 2.1.8\jar\db.jar" bdb.java
C:\Users\C\Desktop\BDB>Client.bat
C:\Users\C\Desktop\BDB>java -classpath .;"C:\Program Files\Sleepycat Softw
are\Berkeley DB XML 2.1.8\jar\dbxml.jar";"C:\Program Files\Sleepycat Software\Be
rkeley DB XML 2.1.8\jar\db.jar" bdb
See there is no OUPUT displayed. Is there somethinglike a 'print' I have to use in this java code.
Any ideas ? Below is the code I am using now
import java.io.File;
import java.io.FileNotFoundException;
import com.sleepycat.db.DatabaseException;
import com.sleepycat.db.Environment;
import com.sleepycat.db.EnvironmentConfig;
import com.sleepycat.dbxml.XmlContainer;
import com.sleepycat.dbxml.XmlException;
import com.sleepycat.dbxml.XmlInputStream;
import com.sleepycat.dbxml.XmlManager;
import com.sleepycat.dbxml.XmlUpdateContext;
import com.sleepycat.dbxml.XmlDocument;
import com.sleepycat.dbxml.XmlQueryContext;
import com.sleepycat.dbxml.XmlQueryExpression;
import com.sleepycat.dbxml.XmlResults;
import com.sleepycat.dbxml.XmlValue;
public class bdb{
public static void main(String[] args)
Environment myEnv = null;
File envHome = new File("D:/xmldata");
try {
EnvironmentConfig envConf = new EnvironmentConfig();
envConf.setAllowCreate(true); // If the environment does not
// exits, create it.
envConf.setInitializeCache(true); // Turn on the shared memory
// region.
envConf.setInitializeLocking(true); // Turn on the locking subsystem.
envConf.setInitializeLogging(true); // Turn on the logging subsystem.
envConf.setTransactional(true); // Turn on the transactional
envConf.setRunRecovery(true);
// subsystem.
myEnv = new Environment(envHome, envConf);
// Do BDB XML work here.
} catch (DatabaseException de) {
// Exception handling goes here
} catch (FileNotFoundException fnfe) {
// Exception handling goes here
} finally {
try {
if (myEnv != null) {
myEnv.close();
} catch (DatabaseException de) {
// Exception handling goes here
XmlManager myManager = null;
XmlContainer myContainer = null;
// The document
String docString = "D:/xmldata/test.xml";
// The document's name.
String docName = "cia";
try {
myManager = new XmlManager(); // Assumes the container currently exists.
myContainer =
myManager.createContainer("twoppro.bdbxml");
myManager.setDefaultContainerType(XmlContainer.NodeContainer); // Need an update context for the put.
XmlUpdateContext theContext = myManager.createUpdateContext(); // Get the input stream.
XmlInputStream theStream =
myManager.createLocalFileInputStream(docString); // Do the actual put
myContainer.putDocument(docName, // The document's name
theStream, // The actual document.
theContext, // The update context
// (required).
null); // XmlDocumentConfig object
theStream.delete();
// Update the title
String STATEMENT1 = "for $n in collection('twoppro.bdbxml')/Bookstore/Book[book_ID=1]/title return replace value of node $n with 'NEWBOOK'";
XmlQueryContext context = myManager.createQueryContext();
XmlQueryExpression queryExpression1 = myManager.prepare(STATEMENT1, context);
System.out.println("Done query: " + STATEMENT1);
queryExpression1.execute(context);
// Get a query context
XmlQueryContext thiscontext = myManager.createQueryContext();
// Set the evaluation type to Lazy.
context.setEvaluationType(XmlQueryContext.Lazy);
// Declare the query string
String queryString =
"for $u in collection('twoppro.dbxml')/Bookstore/Book/[bookid=1]"
+ "return $u/title";
// Prepare (compile) the query
XmlQueryExpression qe = myManager.prepare(queryString, thiscontext);
XmlResults results = qe.execute(thiscontext);
System.out.println("ok");
System.out.println(results);
} catch (XmlException e) {
// Error handling goes here. You may want to check
// for XmlException.UNIQUE_ERROR, which is raised
// if a document with that name already exists in
// the container. If this exception is thrown,
// try the put again with a different name, or
// use XmlModify to update the document.
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally {
try {
if (myContainer != null) {
myContainer.close();
if (myManager != null) {
myManager.close();
} catch (XmlException ce) {
// Exception handling goes here
Thanks. -
Error while schedulingg update stat in db13
Dear Experts,
Please look into my issue we are facing an error while scheduling update statistics in db13 and I tried to open detailed log
It is given
SXPG_COMMAND_EXECUTE failed for BRTOOLS - Reason: program_start_error: For More Information, See SYS
Please help me how to solve this my error
RegardsHi,
Check the owner for BRBACKUP, BRARCHIVE, and BRCONNECT in kernel,
these files should be with SIDADM, if not change the owner to SIDADM and rerun the update stats.
and also Refer the note 446172
Regards,
Ram
Maybe you are looking for
-
Delivery address in Third party process.
Dear All, I have one query in third party process. Created third part sales order,where PR is generated automatically.Based on PR (purchase requisation) created Purchase order. When I select item category S-Third party,system will pick the delivery a
-
OBIEE11g: Set user privileges to Open RPD in Read Only mode.
Hi All, Can some one help me , how to set user privileges to open RPD in read only mode. 1) If a user ( xxxx) logs into the RPD then the rpd should open in Read Only Mode for xxxx user. 2) If other user (YYYY) logs in online mode then it should open
-
Connect MacBook 13inch Aluminum (Late 2008) to RCA input on conventional TV
Him does anyone know if I can use the Mini DisplayPort to DVI Adapter and the Apple DVI to Video Adapter to connect my Macbook to a conventional TV that only has RCA video inputs? Thanks!
-
All, Has anyone tried to create a Gantt chart format in reporting? So if you Created a Custom Object called Project and wanted to reflect the timeline of activities it would show as a Gantt chart? cheers Alex
-
Hi, Jdeveloper 10g 10.1.3.3 (OAF) with jdk 1.5.0_22 shows empty main frame without any controls. But if I click on that frame in chaotic order the header text of main frame is changing. It seems like controls are exists, but not visible. If I use jdk