Unsupported Screen Size: The viewport size is too small for the theme to render properly.

running sja at time

forums forums SQLyog Using SQLyog running sja at time

  • This topic is empty.
Viewing 9 reply threads
  • Author
    Posts
    • #9018
      lvincent
      Member

      hello once again,

      is there anyway which we could run sja all the time? because we would like to synchronize our database during the days operation. may we know the syntax? or perhaps a sample code will be very much useful.

      thanks in advance.

      larry 🙂

    • #17974
      peterlaursen
      Participant

      very simple 😀

      create a windows/DOS “myjob.bat”-file like

      (if it's the Linux version of SJA, you must help yourselv to find something equal)

      content of myjob.bat:

      Quote:
      :label1

      sja myjob.xml

      goto label1

      then run the .bat file. It wil start all over again when it has finished! Note that in this case you should not use the windows scheduler at all!

    • #17975
      CalEvans
      Member

      2 things

      1: In Linux/Unix, it's called cron.

      2: This is a bad idea. If you need a database that is fully replicated, setup a master->slave relationship between 2 databases. This is a much safer way to make sure you have a backup.

      =C=

    • #17976
      peterlaursen
      Participant

      that depends I think …

      If it's a full replication running always it's best the way as CalEvans describes it. But if it is only some tables and some colums that need to be sync'ed and only in certain periods I belive the .bat-file solution is acceptable. And you can only use CalEvans's proposal if your are in control of both server configurations. If it's webhosting <> local server I don't see how it can be done. At least you must be a very important customer to persuade the hosting company … and pay for it!

      The main drawback with the .bat-file-solution is that someone might accidently close it and you'll get no warning.

      Actually I very often use the bat-file method when sync'ing because some rows may be skipped for some reason (with me it's mostly due to a not to stable network connection to the server at my webhost, but it could also simply because of locks if the server is accessed by other users). But what does not come in the first run comes in the next. I let it run until it says “Inserted 0 , updated 0 , Deleted 0”

    • #17977
      lvincent
      Member

      thanks for ideas guys but i'm currently running linux and our setup is RH9 and Mysql 5.0.2.. And with regards to the 'rows that will be skip?', how often will it happen? this is not really a good thing for me because we are creating a POS system and at the same time and inventory system for a department store. can sja manage to handle around 25 terminals or even more? all of these will be synch..

      would you recommend cron? i haven't tried using this one but i will try and give it a shot, since then it is my only option.

      thanks

      larry 🙂

    • #17978
      peterlaursen
      Participant

      Two comments:

      1)

      You write:

      “can sja manage to handle around 25 terminals”

      would you let each terminal use it's own copy of the database ?? Why not connect to ONE database ?

      2)

      How often skipping rows will happen ? Depends! In my case I think that typically about 1/1000 of the rows are skipped due to server not responding when SJA attempts to read (that's why I rerun SJA using a loop from a .bat-file until it's done!). But it also could be due to “read-locks” applied by other applications.

    • #17979
      lvincent
      Member

      yes, i do have a local copy of the database in each terminal. it's the only idea i have think of, or if you have any suggestions much better. that idea of this is because, what if the server bugs down, then the local database will be used. and since we have a local database, the only tool that i think that is more reliable is SJA. but were still looking for alternative ways aside frm having a local copy of the database.

      i don't really know if having a local database and running SJA is the best option for now but so far it's our only option.

      larry 🙂

    • #17980
      peterlaursen
      Participant

      You write “what if the server bugs down”.

      Well, with MySQL 4.1 and above there is the possiblity of clustering. Considered that ?

      You could get into terrible problems if two terminals update (or delete) the same row(s) between sync's. And just thinking of the chances of conflicting PK's with 1 “master database” and 25 “terminal databases”.

      Besides I don't think MySQL 5.0.2 is fit for a production environment. But probably 5.0.7 is coming soon and that could be …

    • #17981
      lvincent
      Member

      okay. thank you so much for the information. well, as of now we don't have an option for synchronization aside from SJA. but i'll try to find an alternative way though.

      do you have any idea which might be helpful to us regarding the synchronization of our setup using SJA?

    • #17982
      Shadow
      Member

      If you are implementing a POS application, then I would use MySql's built-in replication capabilities as they offer continous sync and recovery options.

Viewing 9 reply threads
  • You must be logged in to reply to this topic.