Delphi Xe5 firedac Database locked error with SQLite database2019 Community Moderator ElectionHow to list the tables in a SQLite database file that was opened with ATTACH?Is it possible to insert multiple rows at a time in an SQLite database?Improve INSERT-per-second performance of SQLite?How to Create a Simple Dictation Pad in Delphi2009+VistaMultiple statements Delphi TZquery (Zeos) errorDelphi: Database is locked (SQLite)Setting a relative path to sqlite database with Delphi and FiredacReading dates from Sqlite with Delphi / FiredacTable locks in SQLite accessed by fireDAC

Why doesn't using two cd commands in bash script execute the second command?

Be in awe of my brilliance!

Is a lawful good "antagonist" effective?

Make a transparent 448*448 image

An Accountant Seeks the Help of a Mathematician

Will a pinhole camera work with instant film?

Latest web browser compatible with Windows 98

How to write cleanly even if my character uses expletive language?

Instead of Universal Basic Income, why not Universal Basic NEEDS?

Does this property of comaximal ideals always holds?

Science-fiction short story where space navy wanted hospital ships and settlers had guns mounted everywhere

Why do passenger jet manufacturers design their planes with stall prevention systems?

Ban on all campaign finance?

Do I need life insurance if I can cover my own funeral costs?

Why does Deadpool say "You're welcome, Canada," after shooting Ryan Reynolds in the end credits?

Is having access to past exams cheating and, if yes, could it be proven just by a good grade?

Happy pi day, everyone!

Welcoming 2019 Pi day: How to draw the letter π?

Why must traveling waves have the same amplitude to form a standing wave?

Why are there 40 737 Max planes in flight when they have been grounded as not airworthy?

How could a scammer know the apps on my phone / iTunes account?

Could the Saturn V actually have launched astronauts around Venus?

How to answer questions about my characters?

What are the possible solutions of the given equation?



Delphi Xe5 firedac Database locked error with SQLite database



2019 Community Moderator ElectionHow to list the tables in a SQLite database file that was opened with ATTACH?Is it possible to insert multiple rows at a time in an SQLite database?Improve INSERT-per-second performance of SQLite?How to Create a Simple Dictation Pad in Delphi2009+VistaMultiple statements Delphi TZquery (Zeos) errorDelphi: Database is locked (SQLite)Setting a relative path to sqlite database with Delphi and FiredacReading dates from Sqlite with Delphi / FiredacTable locks in SQLite accessed by fireDAC










1















I am trying to create a simple object to handle all my database related functions. I have a functions to return a dataset or to execute a command. Now when i call this from my program I am able to fetch records using Execute_Dataset and it works fine but when i do an changes and execute a command by calling Execute_Command i get an error "database is locked" when the commit transaction is called. I have tried everything that i could be it still happens. Can someone put some light into what i am doing wrong and how i can prevent this from happening.



 function TConnectionManager.Execute_Dataset(const ASql: string; const AParams:
array of variant; out VDataset: TDataset; const ATrn_Name: string): Boolean;
var
lTrn: TFDTransaction;
lQry: TFDQuery;
begin
Result := True;
lTrn:= TFDTransaction.Create (Self);
try
lTrn.Connection := FConnection;
lTrn.StartTransaction;
lQry := TFDQuery.Create (Self);
lQry.Connection := FConnection;
lQry.Transaction := lTrn;
try
if Length (AParams) > 0
then lQry.Open (ASql, AParams)
else lQry.Open (ASql);
VDataset := lQry;
Result := True;
Commit transaction if started within the procedure
lTrn.Commit;
except
on e:Exception
do begin
Rollback transaction if started within the procedure
lTrn.Rollback;
lQry.DisposeOf;
//log
raise;
end;
end;
finally
lTrn.DisposeOf;
end;
end;



procedure TConnectionManager.Execute_Command(const ASql: string; const AParams:
array of variant; const ATrn_Name: string);
var
lTrn: TFDTransaction;
lQry: TFDQuery;
begin
lTrn:= TFDTransaction.Create (Self);
try
lTrn.Connection := FConnection;
lTrn.StartTransaction;
lQry := TFDQuery.Create (Self);
lQry.Connection := FConnection;
lQry.Transaction := lTrn;
try
Execute command
if Length (AParams) > 0
then lQry.ExecSQL (ASql, AParams)
else lQry.ExecSQL (ASql);
Commit transaction if started within the procedure
lTrn.Commit;
except
on e:Exception
do begin
Rollback transaction if started within the procedure
lTrn.Rollback;
//log
raise;
end;
end;
finally
lQry.DisposeOf;
lTrn.DisposeOf;
end;
end;


Thanks










share|improve this question
























  • The connection component is something that I create within the object but instead if I drop a connection component on to my form and pass it into the object it works fine. This says that there is some property that is not set which is causing the problem. Is there any other properties that should be set on the connection component.

    – Razal K.A
    Apr 9 '14 at 23:43












  • Put a connection on your form, set it up so that it works properly. Then right-click on your form, choose View as text from the context menu, and search for the connection. You can see what the property values are on the component from the resulting text. Copy them into the clipboard. Then right-click the text, choose View as form, and paste the clipboard content into a comment in your code. You can then set those same properties in your code (and know what the values are you should assign to those properties).

    – Ken White
    Apr 9 '14 at 23:59











  • I have tried that and the created connection has all the same values set which is nothing more than the driver name and the database file path.

    – Razal K.A
    Apr 10 '14 at 0:50











  • Sorry. Too much missing info, then. What is the purpose of the ATrn_Name parameter, which you never use? What is the content of ASql when the exception is raised? What was the last operation prior to the exception (what was done last before Exec_Command raises the exception)? If the same setup works when done with a component on the form, what does the debugger tell you when you step through the code? There are a lot of missing details here.

    – Ken White
    Apr 10 '14 at 1:03











  • Hi, I wanted to create and maintain different transaction and ATrn_Name will tell which transaction to use but i have discarded this option and am creating a transaction for each operation as in the code. As for the flow I connect to the database call the execute_reader with the select statement to get the data from a table which will be filled into a list displayed on the screen. Now when i try to add a new record i call the execute_command with the insert statement. The error happens at the point where the transaction is committed (lTrn.commit) in the execute_command method.

    – Razal K.A
    Apr 10 '14 at 1:56















1















I am trying to create a simple object to handle all my database related functions. I have a functions to return a dataset or to execute a command. Now when i call this from my program I am able to fetch records using Execute_Dataset and it works fine but when i do an changes and execute a command by calling Execute_Command i get an error "database is locked" when the commit transaction is called. I have tried everything that i could be it still happens. Can someone put some light into what i am doing wrong and how i can prevent this from happening.



 function TConnectionManager.Execute_Dataset(const ASql: string; const AParams:
array of variant; out VDataset: TDataset; const ATrn_Name: string): Boolean;
var
lTrn: TFDTransaction;
lQry: TFDQuery;
begin
Result := True;
lTrn:= TFDTransaction.Create (Self);
try
lTrn.Connection := FConnection;
lTrn.StartTransaction;
lQry := TFDQuery.Create (Self);
lQry.Connection := FConnection;
lQry.Transaction := lTrn;
try
if Length (AParams) > 0
then lQry.Open (ASql, AParams)
else lQry.Open (ASql);
VDataset := lQry;
Result := True;
Commit transaction if started within the procedure
lTrn.Commit;
except
on e:Exception
do begin
Rollback transaction if started within the procedure
lTrn.Rollback;
lQry.DisposeOf;
//log
raise;
end;
end;
finally
lTrn.DisposeOf;
end;
end;



procedure TConnectionManager.Execute_Command(const ASql: string; const AParams:
array of variant; const ATrn_Name: string);
var
lTrn: TFDTransaction;
lQry: TFDQuery;
begin
lTrn:= TFDTransaction.Create (Self);
try
lTrn.Connection := FConnection;
lTrn.StartTransaction;
lQry := TFDQuery.Create (Self);
lQry.Connection := FConnection;
lQry.Transaction := lTrn;
try
Execute command
if Length (AParams) > 0
then lQry.ExecSQL (ASql, AParams)
else lQry.ExecSQL (ASql);
Commit transaction if started within the procedure
lTrn.Commit;
except
on e:Exception
do begin
Rollback transaction if started within the procedure
lTrn.Rollback;
//log
raise;
end;
end;
finally
lQry.DisposeOf;
lTrn.DisposeOf;
end;
end;


Thanks










share|improve this question
























  • The connection component is something that I create within the object but instead if I drop a connection component on to my form and pass it into the object it works fine. This says that there is some property that is not set which is causing the problem. Is there any other properties that should be set on the connection component.

    – Razal K.A
    Apr 9 '14 at 23:43












  • Put a connection on your form, set it up so that it works properly. Then right-click on your form, choose View as text from the context menu, and search for the connection. You can see what the property values are on the component from the resulting text. Copy them into the clipboard. Then right-click the text, choose View as form, and paste the clipboard content into a comment in your code. You can then set those same properties in your code (and know what the values are you should assign to those properties).

    – Ken White
    Apr 9 '14 at 23:59











  • I have tried that and the created connection has all the same values set which is nothing more than the driver name and the database file path.

    – Razal K.A
    Apr 10 '14 at 0:50











  • Sorry. Too much missing info, then. What is the purpose of the ATrn_Name parameter, which you never use? What is the content of ASql when the exception is raised? What was the last operation prior to the exception (what was done last before Exec_Command raises the exception)? If the same setup works when done with a component on the form, what does the debugger tell you when you step through the code? There are a lot of missing details here.

    – Ken White
    Apr 10 '14 at 1:03











  • Hi, I wanted to create and maintain different transaction and ATrn_Name will tell which transaction to use but i have discarded this option and am creating a transaction for each operation as in the code. As for the flow I connect to the database call the execute_reader with the select statement to get the data from a table which will be filled into a list displayed on the screen. Now when i try to add a new record i call the execute_command with the insert statement. The error happens at the point where the transaction is committed (lTrn.commit) in the execute_command method.

    – Razal K.A
    Apr 10 '14 at 1:56













1












1








1








I am trying to create a simple object to handle all my database related functions. I have a functions to return a dataset or to execute a command. Now when i call this from my program I am able to fetch records using Execute_Dataset and it works fine but when i do an changes and execute a command by calling Execute_Command i get an error "database is locked" when the commit transaction is called. I have tried everything that i could be it still happens. Can someone put some light into what i am doing wrong and how i can prevent this from happening.



 function TConnectionManager.Execute_Dataset(const ASql: string; const AParams:
array of variant; out VDataset: TDataset; const ATrn_Name: string): Boolean;
var
lTrn: TFDTransaction;
lQry: TFDQuery;
begin
Result := True;
lTrn:= TFDTransaction.Create (Self);
try
lTrn.Connection := FConnection;
lTrn.StartTransaction;
lQry := TFDQuery.Create (Self);
lQry.Connection := FConnection;
lQry.Transaction := lTrn;
try
if Length (AParams) > 0
then lQry.Open (ASql, AParams)
else lQry.Open (ASql);
VDataset := lQry;
Result := True;
Commit transaction if started within the procedure
lTrn.Commit;
except
on e:Exception
do begin
Rollback transaction if started within the procedure
lTrn.Rollback;
lQry.DisposeOf;
//log
raise;
end;
end;
finally
lTrn.DisposeOf;
end;
end;



procedure TConnectionManager.Execute_Command(const ASql: string; const AParams:
array of variant; const ATrn_Name: string);
var
lTrn: TFDTransaction;
lQry: TFDQuery;
begin
lTrn:= TFDTransaction.Create (Self);
try
lTrn.Connection := FConnection;
lTrn.StartTransaction;
lQry := TFDQuery.Create (Self);
lQry.Connection := FConnection;
lQry.Transaction := lTrn;
try
Execute command
if Length (AParams) > 0
then lQry.ExecSQL (ASql, AParams)
else lQry.ExecSQL (ASql);
Commit transaction if started within the procedure
lTrn.Commit;
except
on e:Exception
do begin
Rollback transaction if started within the procedure
lTrn.Rollback;
//log
raise;
end;
end;
finally
lQry.DisposeOf;
lTrn.DisposeOf;
end;
end;


Thanks










share|improve this question
















I am trying to create a simple object to handle all my database related functions. I have a functions to return a dataset or to execute a command. Now when i call this from my program I am able to fetch records using Execute_Dataset and it works fine but when i do an changes and execute a command by calling Execute_Command i get an error "database is locked" when the commit transaction is called. I have tried everything that i could be it still happens. Can someone put some light into what i am doing wrong and how i can prevent this from happening.



 function TConnectionManager.Execute_Dataset(const ASql: string; const AParams:
array of variant; out VDataset: TDataset; const ATrn_Name: string): Boolean;
var
lTrn: TFDTransaction;
lQry: TFDQuery;
begin
Result := True;
lTrn:= TFDTransaction.Create (Self);
try
lTrn.Connection := FConnection;
lTrn.StartTransaction;
lQry := TFDQuery.Create (Self);
lQry.Connection := FConnection;
lQry.Transaction := lTrn;
try
if Length (AParams) > 0
then lQry.Open (ASql, AParams)
else lQry.Open (ASql);
VDataset := lQry;
Result := True;
Commit transaction if started within the procedure
lTrn.Commit;
except
on e:Exception
do begin
Rollback transaction if started within the procedure
lTrn.Rollback;
lQry.DisposeOf;
//log
raise;
end;
end;
finally
lTrn.DisposeOf;
end;
end;



procedure TConnectionManager.Execute_Command(const ASql: string; const AParams:
array of variant; const ATrn_Name: string);
var
lTrn: TFDTransaction;
lQry: TFDQuery;
begin
lTrn:= TFDTransaction.Create (Self);
try
lTrn.Connection := FConnection;
lTrn.StartTransaction;
lQry := TFDQuery.Create (Self);
lQry.Connection := FConnection;
lQry.Transaction := lTrn;
try
Execute command
if Length (AParams) > 0
then lQry.ExecSQL (ASql, AParams)
else lQry.ExecSQL (ASql);
Commit transaction if started within the procedure
lTrn.Commit;
except
on e:Exception
do begin
Rollback transaction if started within the procedure
lTrn.Rollback;
//log
raise;
end;
end;
finally
lQry.DisposeOf;
lTrn.DisposeOf;
end;
end;


Thanks







sqlite delphi firedac database-locking






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Oct 9 '14 at 16:07









Dreamwalker

2,51242358




2,51242358










asked Apr 9 '14 at 22:03









Razal K.ARazal K.A

2413




2413












  • The connection component is something that I create within the object but instead if I drop a connection component on to my form and pass it into the object it works fine. This says that there is some property that is not set which is causing the problem. Is there any other properties that should be set on the connection component.

    – Razal K.A
    Apr 9 '14 at 23:43












  • Put a connection on your form, set it up so that it works properly. Then right-click on your form, choose View as text from the context menu, and search for the connection. You can see what the property values are on the component from the resulting text. Copy them into the clipboard. Then right-click the text, choose View as form, and paste the clipboard content into a comment in your code. You can then set those same properties in your code (and know what the values are you should assign to those properties).

    – Ken White
    Apr 9 '14 at 23:59











  • I have tried that and the created connection has all the same values set which is nothing more than the driver name and the database file path.

    – Razal K.A
    Apr 10 '14 at 0:50











  • Sorry. Too much missing info, then. What is the purpose of the ATrn_Name parameter, which you never use? What is the content of ASql when the exception is raised? What was the last operation prior to the exception (what was done last before Exec_Command raises the exception)? If the same setup works when done with a component on the form, what does the debugger tell you when you step through the code? There are a lot of missing details here.

    – Ken White
    Apr 10 '14 at 1:03











  • Hi, I wanted to create and maintain different transaction and ATrn_Name will tell which transaction to use but i have discarded this option and am creating a transaction for each operation as in the code. As for the flow I connect to the database call the execute_reader with the select statement to get the data from a table which will be filled into a list displayed on the screen. Now when i try to add a new record i call the execute_command with the insert statement. The error happens at the point where the transaction is committed (lTrn.commit) in the execute_command method.

    – Razal K.A
    Apr 10 '14 at 1:56

















  • The connection component is something that I create within the object but instead if I drop a connection component on to my form and pass it into the object it works fine. This says that there is some property that is not set which is causing the problem. Is there any other properties that should be set on the connection component.

    – Razal K.A
    Apr 9 '14 at 23:43












  • Put a connection on your form, set it up so that it works properly. Then right-click on your form, choose View as text from the context menu, and search for the connection. You can see what the property values are on the component from the resulting text. Copy them into the clipboard. Then right-click the text, choose View as form, and paste the clipboard content into a comment in your code. You can then set those same properties in your code (and know what the values are you should assign to those properties).

    – Ken White
    Apr 9 '14 at 23:59











  • I have tried that and the created connection has all the same values set which is nothing more than the driver name and the database file path.

    – Razal K.A
    Apr 10 '14 at 0:50











  • Sorry. Too much missing info, then. What is the purpose of the ATrn_Name parameter, which you never use? What is the content of ASql when the exception is raised? What was the last operation prior to the exception (what was done last before Exec_Command raises the exception)? If the same setup works when done with a component on the form, what does the debugger tell you when you step through the code? There are a lot of missing details here.

    – Ken White
    Apr 10 '14 at 1:03











  • Hi, I wanted to create and maintain different transaction and ATrn_Name will tell which transaction to use but i have discarded this option and am creating a transaction for each operation as in the code. As for the flow I connect to the database call the execute_reader with the select statement to get the data from a table which will be filled into a list displayed on the screen. Now when i try to add a new record i call the execute_command with the insert statement. The error happens at the point where the transaction is committed (lTrn.commit) in the execute_command method.

    – Razal K.A
    Apr 10 '14 at 1:56
















The connection component is something that I create within the object but instead if I drop a connection component on to my form and pass it into the object it works fine. This says that there is some property that is not set which is causing the problem. Is there any other properties that should be set on the connection component.

– Razal K.A
Apr 9 '14 at 23:43






The connection component is something that I create within the object but instead if I drop a connection component on to my form and pass it into the object it works fine. This says that there is some property that is not set which is causing the problem. Is there any other properties that should be set on the connection component.

– Razal K.A
Apr 9 '14 at 23:43














Put a connection on your form, set it up so that it works properly. Then right-click on your form, choose View as text from the context menu, and search for the connection. You can see what the property values are on the component from the resulting text. Copy them into the clipboard. Then right-click the text, choose View as form, and paste the clipboard content into a comment in your code. You can then set those same properties in your code (and know what the values are you should assign to those properties).

– Ken White
Apr 9 '14 at 23:59





Put a connection on your form, set it up so that it works properly. Then right-click on your form, choose View as text from the context menu, and search for the connection. You can see what the property values are on the component from the resulting text. Copy them into the clipboard. Then right-click the text, choose View as form, and paste the clipboard content into a comment in your code. You can then set those same properties in your code (and know what the values are you should assign to those properties).

– Ken White
Apr 9 '14 at 23:59













I have tried that and the created connection has all the same values set which is nothing more than the driver name and the database file path.

– Razal K.A
Apr 10 '14 at 0:50





I have tried that and the created connection has all the same values set which is nothing more than the driver name and the database file path.

– Razal K.A
Apr 10 '14 at 0:50













Sorry. Too much missing info, then. What is the purpose of the ATrn_Name parameter, which you never use? What is the content of ASql when the exception is raised? What was the last operation prior to the exception (what was done last before Exec_Command raises the exception)? If the same setup works when done with a component on the form, what does the debugger tell you when you step through the code? There are a lot of missing details here.

– Ken White
Apr 10 '14 at 1:03





Sorry. Too much missing info, then. What is the purpose of the ATrn_Name parameter, which you never use? What is the content of ASql when the exception is raised? What was the last operation prior to the exception (what was done last before Exec_Command raises the exception)? If the same setup works when done with a component on the form, what does the debugger tell you when you step through the code? There are a lot of missing details here.

– Ken White
Apr 10 '14 at 1:03













Hi, I wanted to create and maintain different transaction and ATrn_Name will tell which transaction to use but i have discarded this option and am creating a transaction for each operation as in the code. As for the flow I connect to the database call the execute_reader with the select statement to get the data from a table which will be filled into a list displayed on the screen. Now when i try to add a new record i call the execute_command with the insert statement. The error happens at the point where the transaction is committed (lTrn.commit) in the execute_command method.

– Razal K.A
Apr 10 '14 at 1:56





Hi, I wanted to create and maintain different transaction and ATrn_Name will tell which transaction to use but i have discarded this option and am creating a transaction for each operation as in the code. As for the flow I connect to the database call the execute_reader with the select statement to get the data from a table which will be filled into a list displayed on the screen. Now when i try to add a new record i call the execute_command with the insert statement. The error happens at the point where the transaction is committed (lTrn.commit) in the execute_command method.

– Razal K.A
Apr 10 '14 at 1:56












2 Answers
2






active

oldest

votes


















3














Try setting the Connection's properties SharedCache to 'False' and LockingMode to 'Normal'.



The default value for the connection's locking mode is 'exclusive' which can cause this problem. You can do this by right clicking on your Connection-Component (on the form) and choosing ConnectionEditor (I'm not quite sure, if that's the right English word for it, but it should be called something like that) and then setting these values.



Alternatively you can set these properties in sourcecode:



connection.Params.Add('SharedCache=False');
connection.Params.Add('LockingMode=Normal');


I'm not sure that this is the best way to solve this problem. There might be a better solution to this.






share|improve this answer
































    0














    Because other connection exist. Check connection component in datamodule
    MyFDConnection.Connected:=False;






    share|improve this answer






















      Your Answer






      StackExchange.ifUsing("editor", function ()
      StackExchange.using("externalEditor", function ()
      StackExchange.using("snippets", function ()
      StackExchange.snippets.init();
      );
      );
      , "code-snippets");

      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "1"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f22974832%2fdelphi-xe5-firedac-database-locked-error-with-sqlite-database%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      3














      Try setting the Connection's properties SharedCache to 'False' and LockingMode to 'Normal'.



      The default value for the connection's locking mode is 'exclusive' which can cause this problem. You can do this by right clicking on your Connection-Component (on the form) and choosing ConnectionEditor (I'm not quite sure, if that's the right English word for it, but it should be called something like that) and then setting these values.



      Alternatively you can set these properties in sourcecode:



      connection.Params.Add('SharedCache=False');
      connection.Params.Add('LockingMode=Normal');


      I'm not sure that this is the best way to solve this problem. There might be a better solution to this.






      share|improve this answer





























        3














        Try setting the Connection's properties SharedCache to 'False' and LockingMode to 'Normal'.



        The default value for the connection's locking mode is 'exclusive' which can cause this problem. You can do this by right clicking on your Connection-Component (on the form) and choosing ConnectionEditor (I'm not quite sure, if that's the right English word for it, but it should be called something like that) and then setting these values.



        Alternatively you can set these properties in sourcecode:



        connection.Params.Add('SharedCache=False');
        connection.Params.Add('LockingMode=Normal');


        I'm not sure that this is the best way to solve this problem. There might be a better solution to this.






        share|improve this answer



























          3












          3








          3







          Try setting the Connection's properties SharedCache to 'False' and LockingMode to 'Normal'.



          The default value for the connection's locking mode is 'exclusive' which can cause this problem. You can do this by right clicking on your Connection-Component (on the form) and choosing ConnectionEditor (I'm not quite sure, if that's the right English word for it, but it should be called something like that) and then setting these values.



          Alternatively you can set these properties in sourcecode:



          connection.Params.Add('SharedCache=False');
          connection.Params.Add('LockingMode=Normal');


          I'm not sure that this is the best way to solve this problem. There might be a better solution to this.






          share|improve this answer















          Try setting the Connection's properties SharedCache to 'False' and LockingMode to 'Normal'.



          The default value for the connection's locking mode is 'exclusive' which can cause this problem. You can do this by right clicking on your Connection-Component (on the form) and choosing ConnectionEditor (I'm not quite sure, if that's the right English word for it, but it should be called something like that) and then setting these values.



          Alternatively you can set these properties in sourcecode:



          connection.Params.Add('SharedCache=False');
          connection.Params.Add('LockingMode=Normal');


          I'm not sure that this is the best way to solve this problem. There might be a better solution to this.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 16 '15 at 9:20









          Michael

          3,19051934




          3,19051934










          answered Mar 16 '15 at 8:53









          SabineSabine

          312




          312























              0














              Because other connection exist. Check connection component in datamodule
              MyFDConnection.Connected:=False;






              share|improve this answer



























                0














                Because other connection exist. Check connection component in datamodule
                MyFDConnection.Connected:=False;






                share|improve this answer

























                  0












                  0








                  0







                  Because other connection exist. Check connection component in datamodule
                  MyFDConnection.Connected:=False;






                  share|improve this answer













                  Because other connection exist. Check connection component in datamodule
                  MyFDConnection.Connected:=False;







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Mar 7 at 12:44









                  CfonCfon

                  937




                  937



























                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f22974832%2fdelphi-xe5-firedac-database-locked-error-with-sqlite-database%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme

                      Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

                      2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived