简体   繁体   English

AS3 / Flash / Air:数据库共享

[英]AS3/Flash/Air: Database sharing

I have an AIR application that stores data in XML files. 我有一个将数据存储在XML文件中的AIR应用程序。 The databases is located in the documentsDirectory folder of a main computer. 数据库位于主计算机的documentsDirectory文件夹中。

Is it possible to update the data of the XML files from other computers of a network? 是否可以从网络的其他计算机更新XML文件的数据?

Many thanks in advance. 提前谢谢了。

UPDATE: 更新:

hypothetically: 假设地:

  • We have a server 我们有一台服务器
  • We have a shared folder with read/write access. 我们有一个具有读/写访问权限的共享文件夹。
  • In the folder we have the database files (XML) 在文件夹中,我们有数据库文件(XML)

Is it possible to update the database file from any computer with access to the shared folder? 是否可以从任何有权访问共享文件夹的计算机上更新数据库文件?

Thanks 谢谢

You can write to the file, but it won't work if multiple application tries to write the file at the same time. 您可以写入文件,但是如果多个应用程序尝试同时写入文件,则该文件将无效。 And, lets say app A changes one data, and app B changes another data. 并且,假设应用程序A更改一个数据,而应用程序B更改另一数据。 App A writes the new XML, then B writes its own version of the XML without acknowledging the changes from A. The changes from A are lost. 应用A编写了新的XML,然后B编写了自己的XML版本,但未确认A的更改。A的更改丢失了。

One way to go here is SQLite. 一种方法是使用SQLite。 Natively supported in AIR. AIR本身支持。 But then again, you can not write the file at the same time from 2 different apps. 但是话又说回来,您不能同时通过2个不同的应用程序写入文件。 AIR is supposed to handle those writing issues, but i already experienced some problems with it. AIR应该可以解决这些书写问题,但是我已经遇到了一些问题。

A much better way to go here would be setting a SQL server up (or any other real DB server, i am no expert) and some php interface. 更好的方法是设置SQL Server(或其他真正的DB服务器,我不是专家)和一些php接口。 Maybe AMFPHP : http://gotoandlearn.com/search.php?q=amf , or simply use urlloaders ... 也许AMFPHP: http ://gotoandlearn.com/search.php?q=amf,或者只是使用urlloaders ...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM