Hi Radim (cc to the list),
it takes so long even when it was being stored from a file on local hard drive. The xml file has about 15 to 20 MB.
Wow. How large is your database? How did you add the documents?
Could you give me the XQuery or the BaseX command to move the file from the TempDB to the TargetDB the quickest possible way?
Sure. There are various ways to do so, here’s just one (based on the database module [1]):
1. upload your document to database 'db-temp'
2. insert documents into final database: db:replace('db', db:list('db-temp'), db:open('db-temp'))
3. remove all your documents from the temporary database: db:delete('db-temp', '/')
You can also drop the temporary database completely via db:drop.
Hope this helps, Christian
[1] http://docs.basex.org/wiki/Database_Module
And how about database cache settings? Is something like that in BaseX?
Thank you in advance for your response. Best regards,
Radim Havlicek
---------- Původní e-mail ---------- Od: Christian Grün christian.gruen@gmail.com Komu: Radim Havlicek radim-havlicek@post.cz Datum: 23. 7. 2019 15:12:04 Předmět: Re: [basex-talk] Transaction Management
Hi Radim,
Do you have a clue how the long update time can be explained? Does it take 20 minutes to upload your document to the BaseX server, or does it take the same time if you update your database directly on the server? If it’s the upload time, you could e.g. insert your document in another temporary database and copy it to the final database in a second step.
Hope this helps, Christian
On Tue, Jul 23, 2019 at 10:34 AM radim-havlicek@post.cz wrote:
Hello.
We use client/server architecture, especially the C# client. I read that:
Read transactions are executed in parallel. If an updating transaction comes in, it will be queued and executed after all previous read transaction have been executed.
We have a web Front-End built on BaseX. We read XML documents stored in the database, and show charts with statistics calculated from those documents. Few times per day, we copy a new document to the database (via REPLACE command to make sure, the document is not stored in the database already).
The problem we are facing is that while big document is being stored to the database (10 to 20 minutes), we cannot read documents from the database and display charts for users on the web interface. The web interface is waiting until the document is stored, and then read the the needed documents, and display the charts. It is very inconvenient for users to wait so long for a chart that is normally displayed in few seconds.
Is there a way we could read the xml documents from the database while another document is being stored to the database? It is very, very needed.
Best regards,
Radim Havlicek
basex-talk@mailman.uni-konstanz.de