Article

From:
To:
Sriram Balasubramanian
Subject:
Re: Why IBToGo is readonly for Android and iOS?
Newsgroup:
embarcadero.public.delphi.database.firedac

Re: Why IBToGo is readonly for Android and iOS?

Hi Sriram, thank you for answering promptly.

I think my database is not read only. Because I can change it from my windows application and from my admin tool.
Command gstat -h mydatabase.ib returns:

Database header page information:         Flags 0         Checksum 12345         Write timestamp Oct 19, 2013 18:11:42         Page size 4096         ODS version 15.0         Oldest transaction 1403         Oldest active 1404         Oldest snapshot 1404         Next transaction 1407         Sequence number 0         Next attachment ID 0         Implementation ID 16         Shadow count 0         Page buffers 0         Next header page 0         Database dialect 3         Creation date Sep 18, 2013 12:37:28         Attributes force write
    Variable header data:         *END*
I did not see any information about read only or deploy as read only. My Admin application shows database as not read only.

I use Delphi Project Deployment Page to deploy database file. I don't know if it haves a feature to change database status to read only or change file status to read only. Is there anyone? I suspected that deploy path could be read only or need some attribute to enable changes in files. I don't know. The problem is not a Android specific, because it happens in iOS too. I checked if Android "Uses Permissions" is set properly to allow "Read/Write external storage" and it is.



The problem is not FireDAC specific, because occurs with IBX too (sorry I tested with IBX instead dbExpress). I compiled and deployed the same application source to Windows, iOS and Android. In Windows works fine and I can change database. But in iOS and Android data can't be change. So, I suppose error is not in connection, transaction or dataset components.



I use some specific code to connect database in iOS and Android (using FireDAC):

{code} procedure Tdtm.conIBBeforeConnect(Sender: TObject); begin   {$IF DEFINED(IOS) or DEFINED(ANDROID)}   conIB.Params.Values['DriverName'] := 'IB';   conIB.Params.Values['Protocol'] := 'Local';   conIB.Params.Values['Server'] := '';
conIB.Params.Values['Database'] := TPath.Combine(TPath.GetDocumentsPath, 'MyDatabase.IB');
  {$ENDIF}
end;

constructor Tdtm.Create(AOwner: TComponent); begin   inherited;   {$IF DEFINED(IOS) or DEFINED(ANDROID)}   conIB.DriverName := 'IB';   {$ENDIF} end; {code}
Could be something wrong here?


The problem continues. If you have some other idea, please answer.
Thank you.
Best regards.
> {quote:title=Sriram Balasubramanian wrote:}{quote}
> Nelson,
> 
> If it was just Android platform having the problem, I would have recommended that you make sure your "Uses Permissions" is set properly to allow "Read/Write external storage", as per http://docwiki.embarcadero.com/RADStudio/XE5/en/Mobile_Tutorial:_Using_InterBase_ToGo_(iOS_and_Android)
> 
> Your destination folders for the database files are also good (for iOS and Android).
> 
> Your report indicates it is not FireDAC specific and happens with dbExpress as well.
> 
> The only other advise I have is to check your database file mode. Is it set to "read only"? InterBase allows deploying "read only" (gfix -mode read_only foo.ib) databases. Such a database will not allow "write" operations (proved by your read queries executing fine but not write operations). You can check the attributes of your database file on Windows using "gstat -h foo.ib"
> 
> I don't know if you are using any FireDAC and/or dbExpress data aware components that don't implicitly allow "write" operations.
> For FireDAC: 
> - check if CheckReadOnly is true. http://docwiki.embarcadero.com/Libraries/XE5/en/FireDAC.Stan.Option.TFDUpdateOptions.CheckReadOnly
> - check if your transaction is set to ReadOnly: http://docwiki.embarcadero.com/Libraries/XE5/en/FireDAC.Stan.Option.TFDTxOptions.ReadOnly
> 
> For dbExpress:
> - check if you are setting poReadOnly property to true if you using a data set provider. http://docwiki.embarcadero.com/RADStudio/XE5/en/Setting_Options_That_Influence_the_Data_Packets
> 
> Best wishes,
> Sriram
> 
> 
> > {quote:title=Nelson Nepomuceno wrote:}{quote}
> > Hello,
> > 
> > I created a simple mobile application that access IBToGo.
> > When I deploy to mobile I can query data, but I can't do any change (insert, update or delete). Application always gives a exception EIBNativeException: [FireDAC][Phys][IB] Feature is not supported.
> > The problem is the same changing data via dbExpress or FireDAC; deploying default IBToGo or IBLite license file; deploying to iOS or Android; and compiling and deploying with Delphi XE4 Enterprise (full license) (only for iOS) or Delphi XE5 Enterprise (Trial) (iOS or Android).
> > 
> > Interbase version is XE3 installed together Delphi.
> > 
> > My database is deployed in iOS to path StartUp\Documents\; and in Android to path assets\internal\
> > 
> > What could be wrong?
> > 
> > Thanks in advance
FYI: Phrase searches are enclosed in either single or double quotes
 
 
Originally created by
Tamarack Associates
Fri, 08 Nov 2024 04:00:11 UTC
Copyright © 2009-2024
HREF Tools Corp.