Load XML file causes delay
Hi,
We have created a Adobe Air application, only we stumble across a delay in handling data. We are loading a XML file (1,8 mb) and process it to flash objects like inputfields etc.
Only on my normal Windows 7 pc it takes 5 sec to load only on a windows server 2013 R2 server its up to 15 sec to process the data. (see screenshot)
Is there someone who has same problem with loading XML data en process it as flash objects?
With best regards,
René
this is an excerpt from a book i wrote (Flash Game Development: In a Social, Mobile and 3D World)
Loops
There are two significantly different loop types in ActionScript. One type that executes from start to end before any other code executes and before anything updates on stage and one type that does neither of those things.
do-loops, for-loops and while-loops
Loop types that execute from start to end before anything updates on stage include do-loops, for-loops and while loops. They cannot be used to animate objects because no matter what code you use to execute the loop and no matter what you do to (try and) slow it down, it will still execute from start to finish before anything changes on stage. They are appropriately used for rapid execution of code.
There is never a situation when you should intentionally slow these loops. However, there are situations when you might want to break these loops into more than one chunk so the stage can update between each chunk.
Chunks
For example, if you have a for-loop that takes 10 seconds to execute, your game will appear to freeze for 10 seconds after this loop starts. Nothing will update on stage and nothing will respond to user input. Either you should warn your user before starting that loop or you should break that loop into several smaller chunks that allow visual updates to the user so they do not think your game is broken.
For example, this for-loop that adds odd numbers (and shows the first m odd numbers sum to m*m) freezes my Flash Player for about 9 seconds.
var i:Number;
var n:Number=3000000000;
var s:Number=0;
var startI:Number=1;
var endI:Number=n
var startTime:int=getTimer();
for (i=startI; i<endI; i+=2) {
s+=i;
// 9 seconds
trace((getTimer()-startTime)/1000,s,n*n/4,s-n*n/4);
The following technique shows how to break this (and any other for-loop) into chunks that allow the Flash Player to update every second.
var i:Number;
var n:Number=3000000000;
var s:Number=0;
var startTime:int=getTimer();
// This is the number chunks into which the previous for-loop will broken. If the // previous for-loop took about 9 seconds, using 10 chunks means there will be updates // about every 0.9 seconds.
var chunks:int=10;
var startI:Number=1;
var endI:Number=n/chunks;
var t:Timer=new Timer(100,1);
t.addEventListener(TimerEvent.TIMER,f);
f();
function f(e:Event=null):void {
for (i=startI; i<endI; i+=2) {
s+=i;
trace("stage update",startI,endI,s);
if (endI<n) {
t.reset();
t.start();
} else {
trace((getTimer()-startTime)/1000,s,n*n/4,s-n*n/4);
startI+=n/chunks;
endI+=n/chunks;
Similar Messages
-
Flash CS5.5: Loading XML-file causes a "Security Sandbox Violation"
Hi,
after upgrading from CS3 to CS5.5, i get a "Security Sandbox Violation" when loading a XML-file. With CS3 everything was fine, but now my file is not working any more. The XML-file and my SWF-file are stored in the same directory and it nether work local nor on the webserver.
I don't know the correct message in english, but flash tells me something like:
"Security Sandbox Violation"
access to file:[]data.xml disconnent - not allowed from file:[]myfile.swf
Why am I not allowed to load an XML-file from the same directory/domain any more? And how can I get my data into my flash-File now?
It doesn't seems to be a Flash-Player-Problem, because an older version with the same code still works. So the problem has to be located in Flash CS5.5
Can anybody help me? Thanks a lot!
SonjaPlease ask such questions on the product specific forums. It is highly doubtful that anyone wil lsee it here.
Mylenium -
Hi.
My PL/SQL procedure loading xml files from oracle logical directory ("c:\temp") and inserting values into columns of the table. I use XSU with procedure:
create or replace procedure insProc(xmlDoc IN CLOB, tableName IN VARCHAR2) is
insCtx DBMS_XMLSave.ctxType;
rows number;
begin
insCtx := DBMS_XMLSave.newContext(tableName); -- get the context handle
rows := DBMS_XMLSave.insertXML(insCtx,xmlDoc); -- this inserts the document
DBMS_XMLSave.closeContext(insCtx); -- this closes the handle
end;
For translate xml document to CLOB, I use :
CREATE OR REPLACE function getdocument(
p_directory in varchar2,
p_filename in varchar2)
return clob
is
l_bfile bfile;
l_clob clob;
begin
l_bfile := bfilename(p_directory, p_filename);
dbms_lob.open(l_bfile);
dbms_lob.createtemporary(l_clob, true, dbms_lob.session);
dbms_lob.loadfromfile(l_clob, l_bfile, dbms_lob.getlength(l_bfile));
dbms_lob.close(l_bfile);
return l_clob;
end getdocument;
I didn't have problem with this procedures. But now i want load my xml files from another computer (i want use URL, not oracle logical directory).
How can i do it, using standart PL/SQL methods?Since you are parsing the XML what prevents you from delaying your requests for the image URL's? You can just as well add the image URL's to some kind of collection and load them after you have processed all the text content.
-
ORA-22288:file or LOB operation FILEOPEN failed while loading XML file.
Hello all,
I am getting the following error messages while loading XML file to Oracle 9i table.
declare
ERROR at line 1:
ORA-22288: file or LOB operation FILEOPEN failed
No such file or directory
ORA-06512: at "SYS.DBMS_LOB", line 504
ORA-06512: at line 10
The script I am using is all follows:-
1. Created a file ldxmldata.sh on unix server directory
dd conv=ucase if=$1|sed 's/<?XML/<?xml/'|sed 's/VERSION/version/'|sed 's
/RECORD/ROW/'|sed 's/DATE/TRANSDATE/'|sed 's/&/-/'|sed 's/\/DATE>// TRANSDATE>/'>$1.UCASE
sqlplus sales/sales@rac @upld.sql $1.UCASE
2. Created SQL file upld.sql on unix server
set serveroutput on
exec DBMS_JAVA.SET_OUTPUT(1000000);
@ldxml.sql bsl.xml.UCASE
commit;
exit
3. Created sql file ldxml.sql on unix server
declare
insCtx DBMS_XMLSave.ctxType;
rows number;
file bfile := bfilename('XML_DIR','&1');
charContent CLOB := ' ';
targetFile bfile;
warning number;
begin
targetFile := file;
DBMS_LOB.fileopen(targetFile, DBMS_LOB.file_readonly);
DBMS_LOB.loadfromFile(charContent,targetFile,DBMS_LOB.getLength(tar
getFile),1,1);
insCtx := DBMS_XMLSave.newContext('sales.s_price');
rows := DBMS_XMLSave.insertXML(insCtx,charContent);
DBMS_XMLSave.closeContext(insCtx);
DBMS_LOB.fileclose(targetFile);
end;
4. As Sys,
Created a directory XML_DIR and assigned it the path of Unix server directory
where the script files reside.
Granted read priviledge on XML_DIR to user sales.
I am getting the above error messages. Kindly help with some possible solution.
Arun Patodia
Bokaro Steel CityHi guys,
Sybrand, aplogoies, the second line of the error stack was on one line in the first post, full error stack below:
ORA-22288: file or LOB operation FILEOPEN failed
The program issued a command but the command length is incorrect.
ORA-06512: at "SYS.DBMS_LOB", line 716
ORA-06512: at "JLMS.LOAD_DATA_UTIL", line 417
ORA-06512: at line 2I have looked at that error code as you mentioned, but the second line here doesn't really help much.
Hoek, i took your advice and tried to replace FILEOPEN with OPEn but got the same error.
Just to clarify as well, I am not using UNC or relative file paths as I know that these can cause problems.
Rgds
Dan -
Error while loading xml files using JDBC
Hi,
I am trying to load xml files into an xmltype table using JDBC calls and am getting this error for some files
LPX-00200: could not convert from encoding UTF-8 to UCS2
The xml files and our database are both UTF-8 encoded. The version of oracle that we have here is 9.2.0.6
Any suggestions in this matter will be greatly appreciated.
Thanks,
UmaI also experienced this problem and unfortunately this solution didn't work for me given that the tag you suggested was already on the XML file.
-
Error while loading XML files into scott user
Hi All,
I'm new to xml files. I need to load xml files into database through OWB.
I have xml file in my local machine & am trying to load into table PO of Scott. Scott is registered as repository user.
Followed same steps as specified in userguide.
But, when executing the procedure ( in two ways one as just table name, and other as user.table name) it is showing the below error:
Procedure is:(1)--with username.tablename
begin
wb_xml_load(
'<OWBXMLRuntime>'||
'<XMLSource>'||
'<file>&&SAMPLES_DIR.sample1.xml</file>'||
'</XMLSource>'||
'<targets>'||
'<target dateFormat="yyyy.MM.dd">scott.PO</target>'||
'</targets>'||
'</OWBXMLRuntime>'
end;
ERROR at line 1:
ORA-20006: Error occurred while truncating target database object SCOTT.PO.
Base exception: ORA-01031: insufficient privileges
ORA-06512: at "OWBSYS.WB_XML_LOAD_F", line 12
ORA-06512: at "OWBSYS.WB_XML_LOAD", line 4
ORA-06512: at "SCOTT.SAMPLE1", line 3
ORA-06512: at line 1
Procedure is:(2) with out username
begin
wb_xml_load(
'<OWBXMLRuntime>'||
'<XMLSource>'||
'<file>&&SAMPLES_DIR.sample1.xml</file>'||
'</XMLSource>'||
'<targets>'||
'<target dateFormat="yyyy.MM.dd">PO</target>'||
'</targets>'||
'</OWBXMLRuntime>'
end;
ERROR at line 1:
ORA-20006: Error occurred while truncating target database object PO.
Base exception: ORA-00942: table or view does not exist
ORA-06512: at "OWBSYS.WB_XML_LOAD_F", line 12
ORA-06512: at "OWBSYS.WB_XML_LOAD", line 4
ORA-06512: at line 2
xml file:
<ROWSET>
<ROW>
<ID>100</ID>
<ORDER_DATE>2000.12.20</ORDER_DATE>
<SHIPTO_NAME>Adrian Howard</SHIPTO_NAME>
<SHIPTO_STREET>500 Marine World Parkway</SHIPTO_STREET>
<SHIPTO_CITY>Redwood City</SHIPTO_CITY>
<SHIPTO_STATE>CA</SHIPTO_STATE>
<SHIPTO_ZIP>94065</SHIPTO_ZIP>
</ROW>
</ROWSET>
Note: Everything works fine if I create PO table in OWBSYS user and execute the procedurein OWBSYS user. OWBSYS.PO table will be loaded.
What privileges are missing, what shouldI do if I want to execute the procedure from scott user and load the table of scott.
Thanks in advance for the help.
Regards,
JoshnaHi Joshna,
Please follow below steps to load xml file to oracle database.
1.First connect to owb (Design Center) through your repository owner user (ex : REP_OWNER).
2. Import WB_XML_LOAD procedure . and exit to repository owner.
3. connect to owb design center through your repository user (ex : REP_USER)
Create New mapping and drag one Constant Operator and create one attribute, paste / edit following code
'<OWBXMLRuntime>'||
'<XMLSource>'||
'<file>E:\SOURCE\emp.xml</file>'||
'</XMLSource>'||
'<targets>'||
'<target truncateFirst = "FALSE" dateFormat="yyyy.MM.dd">rep_user.emp</target>'||
'</targets>'||
'</OWBXMLRuntime>'
4. Drag pre mapping operator and select WB_XML_LOAD procedure
5. Connect Constant Operator attribute to pre mapping operator.
6. Drag two dummy tables and connect source to target. (ex : drag t1 (table) tab two times and connect.
7. Validate and deploy the mapping.
8. grant necessary grant command to rep_owner user to rep_user user.
(Note : target truncateFirst = "FALSE" by default truncate the table. So you have to give grant privileges
To rep_user , select ,insert, delete privileges.
9. Execute the mapping , and check EMP table. (Note : before loading EMP table delete all records ).
10 . If you want more description please go through the below link
http://download.oracle.com/docs/html/A95931_01/apf.htm
Regards
Venkat -
Load XML file from addon domain without cross-domain Policy file
Hello.
Assuming that there are two addon domains on the same server: /public_html/domain1.com and /public_html/domain2.com
I try to load XML file from domain2.com into domain1.com without using cross-domain policy file (since it doesn’t work on xml files in my case).
So the idea is to use php file in order to load XML and read it back to flash.
I’ve found an interesting scripts that seems to do the job but unfortunately I can't get it to work. In my opinion there is somewhere problem with AS3 part. Please take a look.
Here are the AS3/PHP scripts:
AS3 (.swf in www.domain1.com):
// location of the xml that you would like to load, full http address
var xmlLoc:String = "http://www.domain2.com/MyFile.xml";
// location of the php xml grabber file, in relation to the .swf
var phpLoc:String = "loadXML.php";
var xml:XML;
var loader:URLLoader = new URLLoader();
var request:URLRequest = new URLRequest(phpLoc+"?location="+escape(xmlLoc) );
loader.addEventListener(Event.COMPLETE, onXMLLoaded);
loader.addEventListener(IOErrorEvent.IO_ERROR, onIOErrorHandler);
loader.load(request);
function onIOErrorHandler(e:IOErrorEvent):void {
trace("There was an error with the xml file "+e);
function onXMLLoaded(e:Event):void {
trace("the rss feed has been loaded");
xml = new XML(loader.data);
// set to string, since it is passed back from php as an object
xml = XML(xml.toString());
xml_txt.text = xml;
PHP (loadXML.php in www.domain1.com):
<?php
header("Content-type: text/xml");
$location = "";
if(isset($_GET["location"])) {
$location = $_GET["location"];
$location = urldecode($location);
$xml_string = getData($location);
// pass the url encoded vars back to Flash
echo $xml_string;
//cURLs a URL and returns it
function getData($query) {
// create curl resource
$ch = curl_init();
// cURL url
curl_setopt($ch, CURLOPT_URL, $query);
//Set some necessary params for using CURL
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//Execute the curl function, and decode the returned JSON data
$result = curl_exec($ch);
return $result;
// close curl resource to free up system resources
curl_close($ch);
?>I think you might be right about permissions/settings on the server for php. Unfortunately I'm not allowed to adjust them.
So I wrote my own script - this time I used file path instead of http address of the XML file. It works fine in my case.
Here it is:
XML file on domain2.com:
<?xml version="1.0" encoding="UTF-8"?>
<gallery>
<image imagePath="galleries/gallery_1/images/1.jpg" thumbPath="galleries/gallery_1/thumbs/1.jpg" file_name= "1"> </image>
<image imagePath="galleries/gallery_1/images/2.jpg" thumbPath="galleries/gallery_1/thumbs/2.jpg" file_name= "2"> </image>
<image imagePath="galleries/gallery_1/images/3.jpg" thumbPath="galleries/gallery_1/thumbs/3.jpg" file_name= "3"> </image>
</gallery>
swf on domain1.com:
var imagesXML:XML;
var variables:URLVariables = new URLVariables();
var varURL:URLRequest = new URLRequest("MyPHPfile.php");
varURL.method = URLRequestMethod.POST;
varURL.data = variables;
var MyLoader:URLLoader = new URLLoader;
MyLoader.dataFormat =URLLoaderDataFormat.VARIABLES;
MyLoader.addEventListener(Event.COMPLETE, XMLDone);
MyLoader.load(varURL);
function XMLDone(event:Event):void {
var imported_XML:Object = event.target.data.imported_XML;
imagesXML = new XML(imported_XML);
MyTextfield_1.text = imagesXML;
MyTextfield_2.text = imagesXML.image[0].attribute("thumbPath"); // sample reference to attribute "thumbPath" of the first element
php file on domain1.com:
<?php
$xml_file = simplexml_load_file('../../domain2.com/galleries/gallery_1/MyXMLfile.xml'); // directory to XML file on the same server
$imported_XML = $xml_file->asXML();
print "imported_XML=" . $imported_XML;
?>
Regards
PS: for those who read the above discussion: the first and the second script work but you must test which one is better in your situation. The first script will also work between two domains on different servers. No cross domain policy file needed. -
Can I load xml file from SWC without using @embed
I'm developing a mobile application in which I need to load xml files from File.applicationDirectory. This works great if the xml files are part of the main application swf. But I would like to move these xml files into a SWC so they could be shared across multiple applications.
Using FlashBuilder 4.5, when a SWC is built, I can specify files to embed in the library that are not assets (Assets Tab of Flex Library Build Path). For various design reasons, I do NOT want to embed the xml files via @embed.
When the swc is built and I open it up using a zip utility, I see the xml files in there just fine. So they are being bundled with the SWC. But how can I load these files in my main application that does not involve using @embed? When the main application is built, the swc setting for link type is "merged into code".
I wouldn't expect the application to automatically pull out the xml files from the swc and place them in the File.applicationDirectory on the mobile device. I've tried loading from there just in case but file.exists is false (as expected).
I've searched the web (and continue to do so) and all the answers seem to be to use @embed. Is there another way?
RandyIt's actually a lot easier than you think.
Just reference the file like any'ol URL using a path relative to the SWC's src directory.
So if you include the file "assets/xml/some.xml", just use that same string like you would any remote resource.
For example:
var loader:URLLoader = new URLLoader( new URLRequest("assets/xml/some.xml"));
I believe it would also work like this "/assets/xml/some.xml", but I prefer relative paths so the link doesnt break if moved out of the SWC... -
How to load XML files ? HELP!
Hi folks.
We have an old Oracle database 7.3..
So we need to load XML files into its tables.
As we understand Oracle Loader doesn't help us.
Is the way to load that files?
Thanks in advance
AlexI know you realize 7.3 is old but this is sort of like trying trying to view a DVD when you only have a VCR. Simple answer would be buy a DVD player, i.e. upgrade to a more recent version of Oracle where you will get many features to handle XML.
How do you want the XML loaded, all as a single object? That could be a CLOB column if 7.3 had them, I am not sure. You would probably have to write PL/SQL and something with UTL_FILE (if 7.3 had that) to load it.
If you want to put it multiple columns based on its tags, you would be better off parsing it using PERL (or something) into a CSV and loading that in SQL*Loader.
I assume as this is using XML it is a reasonably recent design, combining that with an ancient version of the database is just going to lead to endless headaches. -
Hi All,
How to load xml file from backend.
i have 5 xml files in databse. i need to get the xml files from database sequentially .means i need to get in a for loop.
how can i do this.
any one can help?
thanks
Raghuis your front end in Flex?
Sammi -
Loading XML File to Physical table in BW
Hi,
I have a requirement to load XML file BW physical table.
The XML file that I am getting looks pretty complex compared to the XML file I have seen online.
I need help in transforming the file and Abap code to load the file to physical table
I have already created the table in SE11.
XML file
<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Row ss:AutoFitHeight="0" ss:Height="36">
<Cell ss:StyleID="s62"><Data ss:Type="String">First Name</Data></Cell>
<Cell ss:StyleID="s62"><Data ss:Type="String">Bank Name -
add. info</Data></Cell>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="22.5" ss:StyleID="s67">
<Cell><Data ss:Type="String">John Mayor</Data></Cell>
<Cell><Data ss:Type="String">New: Local bank</Data></Cell
</Row>
my requirement is to get this values into physical table i.e
First name bank name
John Mayor new: local bank
thanks
Edited by: Bhat Vaidya on Apr 14, 2010 11:59 AM
Edited by: Bhat Vaidya on Apr 14, 2010 12:00 PM
Edited by: Bhat Vaidya on Apr 14, 2010 12:01 PM
Edited by: Bhat Vaidya on Apr 14, 2010 12:01 PMNo longer working on the issue.
-
Hi,
I have a requirement to load XML file from Application server to BI 7. Most of the documents I saw online are related to BW 3.X.
does any one have good examples of how this can be done in BI 7.
thankshi
check the SAP documentation for loading XML file to BI
http://help.sap.com/saphelp_nw70/helpdata/en/fe/65d03b3f34d172e10000000a11402f/frameset.htm -
Loading xml file to javascript
hi,
i want to load xml file from javascript and to get the tree structure dynamically..
xml file is:
<?xml version="1.0"?>
<personal>Personal Details
<name>Premshree Pillai</name>
<***>male</***>
<websites>Websites
<ws1>http://www.qiksearch.com</ws1>
<ws2>http://premshree.resource-locator.com</ws2>
</websites>
</personal>
pls send me steps to get the tree structure
thankshi,
In google i am gettting only static tree...
i want dynamic tree structure , where nodes are coming from xml file
dynamically -
Hi,
I have a requirement to load xml file into SAP. Can you please tell me most efficient way to do this? Is there any function available in SAP to load xml file?
Please let me know. I would really appreciate this.
Regards,
SanjeevHI,
This is the link which will give you the Code
http://www.geocities.com/rmtiwari/Resources/MySolutions/Dev/Codes/Report/Z_RMTIWARI_XML_TO_ABAP_46C.html
Use this XML file to Upload the same, this Program will work for your XML file also,
http://www.geocities.com/rmtiwari/Resources/MySolutions/Dev/Codes/Report/input_xml.xml
See the below thread also
Upload XML to internal table and vice versa in SAP 4.6C
look at the below function moduel .. <b>TEXT_CONVERT_XML_TO_SAP</b>
Regards
Sudheer -
Hi Gurus,
I am new to owb and as per requirement we need to load xml files into oracle table using owb.
below is the xml file:
<bookstore>
<book category="COOKING">
<title lang="en">Everyday Italian</title>
<author>Giada De Laurentiis</author>
<year>2005</year>
<price>30.00</price>
</book>
<book category="CHILDREN">
<title lang="en">Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
<book category="WEB">
<title lang="en">Learning XML</title>
<author>Erik T. Ray</author>
<year>2003</year>
<price>39.95</price>
</book>
</bookstore>
please help me in loading above xml file using owb.You can leverage the XML SQL functions to extract from XML using the database, see the blog post below;
https://blogs.oracle.com/warehousebuilder/entry/leveraging_xdb
For example to extract information from your XML document the following SQL can be generated from OWB;
select extractValue(value(s), '/book/author'),
extractValue(value(s), '/book/year'),
extractValue(value(s), '/book/price') from
( select XMLType('<bookstore>
+<book category="COOKING">+
+<title lang="en">Everyday Italian</title>+
+<author>Giada De Laurentiis</author>+
+<year>2005</year>+
+<price>30.00</price>+
+</book>+
+<book category="CHILDREN">+
+<title lang="en">Harry Potter</title>+
+<author>J K. Rowling</author>+
+<year>2005</year>+
+<price>29.99</price>+
+</book>+
+<book category="WEB">+
+<title lang="en">Learning XML</title>+
+<author>Erik T. Ray</author>+
+<year>2003</year>+
+<price>39.95</price>+
+</book>+
+</bookstore>') adoc from dual+) r,
table(XMLSequence(extract(r.adoc, '/bookstore/book'))) s;
Cheers
David
Maybe you are looking for
-
Transferring iTunes library to main user account
I have recently upgraded to a mac after using a PC for many years. I set up my MAC with a user account and then once we upgraded to Lion, used migration assistant to copy all the PC files across - it copied them into a new user account on my MAC (whi
-
Error in End-to-End Monitoring
Dear All, when i click display on End-to-End Monitoring, and then not accepting any user etc and the following error message come up Logon failed error Call of URL http://sapxi:50010/sap/bc/bsp/sap/spi_monitor/monitor.do terminated due to error in lo
-
Send an Email If there is no Processed message for the Day
Hi all, I have to send an Email if there is no file processed in XI for that particular interface on that day. Is it possible and How? Regards
-
Images are always placed -2pt below base line - how to change?
Hi all, for small icons that should appear in the text, we use image elements within the paragraph. When I select the placement option at insertion point, then the image is always placed -2pt "above" the base line (thus, actually below the line). If
-
Dear Concern, yesterday after installing new update 8.0.1(12a402) on my iphone 5 after install this update my cellular strength is to low kindly solve this issue