Jump to content



Photo

Sqlite Max Simultaneous Sonnections


  • Please log in to reply
5 replies to this topic

#1 BigEfromDaBX

BigEfromDaBX

    Advanced Member

  • Members
  • PipPipPip
  • 323 posts
  • OS:Windows 8
  • Total Memory:< 1Gb
  • Framework:v3.5
  • License:Standard Edition

Posted 05 August 2018 - 04:36 PM

Does sqlite have a limit on how many clients can connect to it.  Can I run two bots to access the DB at the same time?

 



#2 HelloInsomnia

HelloInsomnia

    Advanced Member

  • Moderators
  • 2747 posts
  • OS:Windows 10
  • Total Memory:More Than 9Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 06 August 2018 - 12:23 PM

Yes that is fine and it can handle multiple connections but if you wanted to write from multiple sources it probably wouldn't hurt to use a mutex. Heopas plugin has a command called "system wide lock" which will allow you to create a mutex - basically this will only allow one program to access it at a time until it reaches the next command which you should use "system wide unlock"



#3 BigEfromDaBX

BigEfromDaBX

    Advanced Member

  • Members
  • PipPipPip
  • 323 posts
  • OS:Windows 8
  • Total Memory:< 1Gb
  • Framework:v3.5
  • License:Standard Edition

Posted 06 August 2018 - 12:24 PM

Yes that is fine and it can handle multiple connections but if you wanted to write from multiple sources it probably wouldn't hurt to use a mutex. Heopas plugin has a command called "system wide lock" which will allow you to create a mutex - basically this will only allow one program to access it at a time until it reaches the next command which you should use "system wide unlock"

 

I only want to write from two sources.



#4 BigEfromDaBX

BigEfromDaBX

    Advanced Member

  • Members
  • PipPipPip
  • 323 posts
  • OS:Windows 8
  • Total Memory:< 1Gb
  • Framework:v3.5
  • License:Standard Edition

Posted 10 August 2018 - 02:15 PM

Yes that is fine and it can handle multiple connections but if you wanted to write from multiple sources it probably wouldn't hurt to use a mutex. Heopas plugin has a command called "system wide lock" which will allow you to create a mutex - basically this will only allow one program to access it at a time until it reaches the next command which you should use "system wide unlock"

 

Just thought of something.  If i have one bot that is doing multi threading writing to the DB, wouldnt that be the same is several bots writing to that DB?



#5 HelloInsomnia

HelloInsomnia

    Advanced Member

  • Moderators
  • 2747 posts
  • OS:Windows 10
  • Total Memory:More Than 9Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted Yesterday, 06:44 PM

Just thought of something.  If i have one bot that is doing multi threading writing to the DB, wouldnt that be the same is several bots writing to that DB?

 

Yes, and you can use a thread lock for this if you want.



#6 BigEfromDaBX

BigEfromDaBX

    Advanced Member

  • Members
  • PipPipPip
  • 323 posts
  • OS:Windows 8
  • Total Memory:< 1Gb
  • Framework:v3.5
  • License:Standard Edition

Posted Yesterday, 07:50 PM

so is this an example of how it works.

 

loop(500) {
    save("test")
}
define save(#text) {
    thread {
        plugin command("HeopasCustom.dll""Heopas Thread Lock")
        save to file("C:\\test.txt",#text)
        plugin command("HeopasCustom.dll""Heopas Thread Unlock")
    }
}






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users