Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Dec 2002
    Location
    the windy city
    Posts
    140
    Thanks
    0
    Thanked 0 Times in 0 Posts

    multiple users and database connection

    ok, so this probably sounds totally stupid, but can somebody explain to me in plain terms how it all works or point me to a place i can read about it?

    so we have 1 database. let's say that a database is being used for a single purpose only, so there's only 1 page containg the script to use with it.
    in asp you would say
    var conn = Server.CreateObject("ADODB.Connection")
    in mivascript you would say
    <MvOPEN NAME="db_alias_name" DATABASE="file_name.dbf" INDEXES="index_name.mvx">
    those are the only 2 server-side languages i know how to do it with.
    anyway, no matter which language you use, you name a database connection.
    so here's a question: how is that name used and by what?
    why am i asking? 'cause i am sitting here and thinking to myself: when several users ar online, running the same script, all of them will create connections with the database with the same variable name. so how does it all work? how does the server, or the database know what results to returm to each individual user when all of them had created connections with the same name?
    i just have no idea how it all works, so can somebody please explain?

  • #2
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,040
    Thanks
    10
    Thanked 92 Times in 90 Posts
    Hi, the name is just a handle , in the same way www . domain.com is just for us humans & gets turned into an IP address for nameservers to crunch

    a DB is pretty similar in that a connection is made from your script processor to the database accross a socket connection on a given port, i.e. MySQL commonly runs on port 3306.

    so MySQL 'listens' for connections on this port,when the DB receives a request it runs as a separate process or thread or instance and is unaware of any other concurrent connections, in a similar way that a 1000 people can look at your site and your webserver treat each one as an individual entity.

    There must be a better way of explaining it but thats the best I can come up with.

    I dont know how win32 handles DataSourceNames though I assume its a similar process?
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #3
    Regular Coder
    Join Date
    Dec 2002
    Location
    the windy city
    Posts
    140
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up oooh, firepages

    you come to the rescue, as always.
    i've been fighting some mivascript for 3 days, sol my brain is dead. their manual is usually pretty good, but as i had found out, it does not explain it all, so i made soma assumption about certain functions that were actually wrong, and could not figure the darn thing out for 3 days! i finally asked the list and bam! but you know how it is, especially when you don't know the language well. you start thinking that your syntax is wrong, then that the 'logic' of your script flow is wrong etc etc anything but not what it actually was.
    so i was looking at
    <MvOPEN NAME="distr_db" DATABASE="innbk.dbf" INDEXES="distr_db_state_name.mvx">
    <MvFIND NAME="distr_db" VALUE="{g.state}">
    and was, *confused*
    uhh, my brains need a break, but it is not even lunch time on thursday.
    i need a weekend to come asap.

    THANKS!

  • #4
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,040
    Thanks
    10
    Thanked 92 Times in 90 Posts


    "whom Mivascript shall destroy , it must first drive mad"

    go down the pub & have a Newcastle Brown ... you will feel better, have a few and you won't care !
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #5
    Regular Coder
    Join Date
    Dec 2002
    Location
    the windy city
    Posts
    140
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by firepages

    "whom Mivascript shall destroy , it must first drive mad"
    LMAO
    you are right as always!

  • #6
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    sounds like mivascript is evil...
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •