Multi-User considerations

Hi everyone,
I'm working on a system, which is supposed to add users to a database. It has a HTML-front-end and a java-servlet working behind the scenes. My problem is, that I don't know how to prevent, that the values of the global variables gets mixed up, if several users use the servlet simultaneously. I don't want to implement the SingleThread-interface, because a multi-user-model is required.
It was suggested to me, that I could use cookies to solve the problem, but since I'm rather new to servlets, I don't know how to implement that.
Basically, my question is this: Does anyone have any good examples demonstrating how to solve this sort of problem? Are there any good tutorials available on-line?

Hi again,
I still have some trouble comprehending the concepts of threads and sessions in relation to servlets.
I've written a student-registration servlet that uses the session-tracking API in it's doPost-method. That means that it identifies the current user. It attaches an object (in this case a student-object) to the session.
Later on, in the doPost-method of a different servlet, I retrieve that student-object from the session, validate it and insert it in my database. I've synchronized my database-related methods but not the doPost-method. My problem is, that I'm unsure whether its possible for a different user's invalid student-object to get inserted between my validation-procedure and the actual writing to the database? Or to re-phrase the question: Do different threads spawn different versions of the doPost-method, or do they use the same? And in that case, is it necessary for me to synchronize the doPost-method?
I hope my question is not to obscure ;-)

Similar Messages

  • Multi User Skype

    Multi User Skype was great until the latest software upgrade, which in my opinion was actually a downgrade. It is now awful - it keeps on dropping out - then users can't connect.  It is totally unreliable. Very dissappointing.
    [Removed for privacy]

    Multi User Skype was great until the latest software upgrade, which in my opinion was actually a downgrade. It is now awful - it keeps on dropping out - then users can't connect.  It is totally unreliable. Very dissappointing.
    [Removed for privacy]

  • File Discrepancies for Multi Users

    Hi ...
    We are running RH7 and RSC3.1 with 3 users - We identified
    (only yesterday) that after User 1 had deleted one topic file from
    Project Manager and added several others ... User 2 and 3 had
    broken links for these topics.
    We are able to update existing topics by one user, who check
    in, then user 2 and 3 can get the latest version and instantly view
    the changes - lovely!! Exactly what we would expect ...
    But the same is not occurring when we remove or add entire
    topics to both the Project Manager and the TOC ...
    User 2 and 3 see the topics in the TOC with the dreaded red
    cross through them ... and have to try and locate the file or
    restore broken links etc ... to get their view of the project in
    sync with User 1. This seems to defeat the whole purpose of being
    able to have a multi user authoring environment????
    A major concern of this problem appears to be the risk of
    undoing each others work by potentially restoring files that
    another user intended to remove ...
    Is anyone else experiencing similar issues ... we are in a
    big organisation and are very restricted in terms of our ability to
    access the servers etc ... but I want to know if there is something
    we should be checking or doing differently from an application
    perspective? Any advice or ideas are greatly appreciated...
    Many thanks ...
    Frustrated!

    Hi Fi@qldpol, and welcome to the board. With your situation,
    there are two likely possibilities:
    1. Was your project added to source control via RoboHelp, or
    was it initially added using RoboSource Control? If it was added
    from RoboSource Control, then that is the problem.
    2. If #1 is not the problem, then you might be having
    problems with some of the users' CPD files. First, have everyone
    make backups of the local version of their project (the files
    actually residing on their PCs). Then have User 2 and User 3 delete
    their copy of the project, and replace it with a copy of User 1's
    local files. Before they open the project, they should delete the
    cpd and pss files. After they delete those files, they can open the
    project as usual and let the cpd file rebuild. We have to do this
    every so often with some of our projects to get everyone
    synchronized.
    Hope that helps.
    G

  • I have windows, one computer but multi users. home sharing is on. how can i share music between users on one computer?

    I have windows.  One computer but multi users.  Home sharing is on. 2 apple accounts-1 per user. 4 devices-2 iphones and 2 ipods per user.  How can we share music  on one computer between 2 users?

    Hi Justinece, I've solved the problem in this way:
    In my wife user profile I've set in itunes settings/advanced the path to my music library: /Users/"MY NAME"/Music/iTunes/Itunes media.
    Than, from my wife profile using my administrator user and password I've set the "read/write" privileges on the above mentioned folder.
    Finally I've added the folder in my wife's library taking care to not duplicate it ( leave blank the flag in itunes setting/advanced).
    I really don't understand what's the use of home sharing...

  • Trying to access Lion server remote using multi-user access, but from a legacy Leopard system

    Just purchased a mini server running Lion, and got screen sharing working fine from my legacy system (32-bit so Leopard only). However, I would like to run in multi-user mode, so someone can use the Lion system and another person can access their own account, from the older Leopard system, at the same time. Using multi-user rather than screen sharing. But Leopard does not have the option on the Finder/Share Screen command, the pop-up window to select screen sharing or new virtual session. So, is there a way still to run a new virtual session from a remote client running Leopard?  Since the multi-user capability resides on the Lion server, it should be possible, but how, without the pop-up menu?
    Message was edited by: Kurt-Syracuse

    Hey. I suggest you check out http://discussions.apple.com/message.jspa?messageID=9839785#9839785, where there are a couple solutions posted in regard to the error code -36 when connecting to a samba share. Good luck!
    Jeremy A.
    Tekserve Intern

  • Multi User Calendar Display Issue

    When we moved to GW2012 one of our departments that uses a Multi User calendar (5 users in total) noticed some strange display issues.
    When User1 is looking at her Multi User Calendar, the client is displaying her appointments in User2's column as well. But if you look at User2's Multi User calendar, you don't see any of User1's appointments in User2's column, so it appears to be a display issue with User1. This same issue is happening with one other user.
    All users are on Client 12.0.2, Build 108211 . Interestingly if we look at the calendar on a machine running the GW8 client this display issue does not occur. I have also gone as far as rebuilding the calendar from scratch but this hasn't changed anything.
    Any suggestions?
    Thanks!
    Steve

    Hi
    If you open a Service Request with Novell Technical Services you will receive this Field Test File patch for the GroupWise 2012 Client. It is specifically to fix issues with multi-user calenders. Please let us know if you are in a position to open an SR.
    Many thanks.
    Cheers,

  • Set multi user column with PowerShell used to work in 2010 but no longer works in 2013

    In SharePoint 2010 I used PowerShell to set the value of multi user people columns and it worked really well.  I attempt to use the same PowerShell to set the same column type in SharePoint 2013 and it fails.
    here is the PowerShell that I use in 2010:
    $web = Get-SPWeb "http://intranet"
    $list = $web.lists["TestList"]
    $item = $list.items.add()
    $item["Title"] = "Test multi user column"
    $users = @("Domain\user1", "Domain\user2")
    $userList = new-object Microsoft.SharePoint.SPFieldUserValueCollection
    foreach($user in $users)
    $spUser = $web.EnsureUser($user)
    $userValue = new-object Microsoft.SharePoint.SPFieldUserValue($web, $spUser.ID, $spUser.Name)
    $userList.Add($userValue)
    $item["MultiUserColumn"] = $userList
    $item.update()
    I have used this on three SharePoint 2013 farms with differing results.  On two of them I receive an error when running $item.update(): Exception calling "Update" with "0" argument(s): "Invalid look-up value.  A look-up
    field contains invalid data. Please check the value and try again."
    If I take one of the users out of the $users list then it works fine, but it will not allow multiple users to be set with PowerShell.  I can use the GUI to add more than one user but not PowerShell.
    Does anyone know if these methods have changed in 2013? I haven't been able to find anyone else with this issue.
    mmm... coffee...

    Not sure but maybe something to do with casting. Below is the code snippet from one of the blogs. Try modifying your script like below and see if still you get the error
    [Microsoft.SharePoint.SPFieldUserValueCollection]$lotsofpeople = New-Object Microsoft.SharePoint.SPFieldUserValueCollection
    $user1 = $w.EnsureUser("domain\user1");
    $user1Value = New-Object Microsoft.SharePoint.SPFieldUserValue($w, $user1.Id, $user1.LoginName)
    $user2 = $w.EnsureUser("domain\user2");
    $user2Value = New-Object Microsoft.SharePoint.SPFieldUserValue($w, $user2.Id, $user2.LoginName);
    $lotsofpeople.Add($user1Value);
    $lotsofpeople.Add($user2Value);
    $i["lotsofpeoplefield"] = $lotsofpeople;
    $i.Update();
    #-or-
    $l.Fields["lotsofpeoplefield"].ParseAndSetValue($i,$lotsofpeople);
    $i.Update();
    Reference to the link
    http://social.technet.microsoft.com/wiki/contents/articles/20831.sharepoint-a-complete-guide-to-getting-and-setting-fields-using-powershell.aspx
    Geetanjali Arora | My blogs |

  • 10.6.2 SMB - QB 2005 PC won't run in Multi User

    Hi there,
    This is a pretty specific issue but i'll throw this out anyway.
    I setup a brand new 10.6.2 server alongside our old 10.4.11 server.
    I cloned the contents of the "shared data" from the old box to the new one.
    We have had the SMB service running for Quickbooks 2005 running on 2 PCs (Xp Pro clients), shared via QB's "Multi User" mode.
    The new server's SMB share, identical in permissions etc to the old one, will not allow QB to open the file in Multi User mode. It gives an error to the effect of "Your company file has been damaged". My attempts to repair the QB file had no effect.
    If I copy the same company file back onto our old Tiger Server's SMB share, it works fine. I assume this is simply a difference in Samba versions, but I have no idea how to troubleshoot it.
    I obviously have a workaround for now, but it's less than ideal to have an entire Xserve on to share a Quickbooks file.
    Any insight would be appreciated.
    ~p

    Bumped into this article; I'll post back after i give it a shot.
    http://edoceo.com/liber/network-samba-quickbooks
    The gist of it:
    "the directories that will be the root of the share must be owned by the group that the users who will access are in and they must be able to write"

  • I purchased the multi-user iworks and recently had to replace my white imac's hard drive but didn't pay to fix the CD drive.  My iworks does not have a serial number on the box and now that my CD drive isn't working how can I reinstall this software?

    I purchased the multi-user iworks (yes back when it was new, 2009 or 2010 and recently had to replace my white imac's hard drive (but didn't pay to fix the CD drive).  My iworks does not have a serial number on the box and now that my CD drive isn't working how can I reinstall this software?

    Buy or borrow an external USB optical drive.
    See the confirmation email or covering letter to obtain the serial number. If you have lost it, contact the supplier.

  • Set Database Back to Multi User from Single User

    I am using SharePoint Services 3.0 (SP1) with default configuration options, which installs the Microsoft##SSEE instance of SQL to my local C:\ drive.
    While attempting to relocate the files to another drive, I set one of the databases (as recommended) to Single User by using the SQL Server Management Express tool.
    I cannot now reset that database to Multi User, even by executing the query
    exec sp_dboption 'database_name', 'single user', ''FALSE'
    again by using the Management Express Tool.
    Can someone please help, in plain english???? Thanks

    I have similar issue.
    I have took backup of WSUS (Windows Server 2002 R2) Windows internal database using SQL Server 2008 Management Studio and restored on Windows Server 2012 R2 Server.
    Now SUSDB database was in Single User mode. I have tried ALTER  DATABASE <<Database Name>>   SET MULTI_USER  WITH NO_WAIT and i'm getting blow error.
    Msg 5069, Level 16, State 1, Line 1
    ALTER DATABASE statement failed.
    How i can change it Multi User?
    Thanks 
    Uma

  • How to set Multi User Environment in the weblogic 5.1 and 6.1 server..(Urgently)

    Hi all,
    I need to know how to set Multi User Environment in the weblogic 5.1
    properties file..
    Here my question is..:)
    1) I have a database with multiple users and having different privileges
    for the users.. and i need to use all the privileges when user aceess
    the database through weblogic server connectionPool.
    2)According to the user privileges i need access the database tables
    content and gives the frontEnd(jsp).
    3)How to modify dynamically weblogic.properties file in the weblogic
    5.1.
    If anybody having idea reg. this issues pl...help me..
    Thanks in advance
    Chandu([email protected],[email protected])

    Hi. A JDBC connection pool is a set of identical, interchangeable, pre-made
    connections, and the controls to make sure only one user uses a particular
    connection at any one time. If you want to have different DBMS users, you can
    have a separate pool for each DBMS user, which may contain as many or few
    connections as you want. Some applications has a pool for the accounting
    applications, and another for the sales applications etc. Some do have a
    separate pool for john, jane, joe etc, each with one connection. Pools
    can be created and destroyed dynamically using the dynamic pool API.
    Joe
    softstar wrote:
    >
    Hi all,
    I need to know how to set Multi User Environment in the weblogic 5.1
    properties file..
    Here my question is..:)
    1) I have a database with multiple users and having different privileges
    for the users.. and i need to use all the privileges when user aceess
    the database through weblogic server connectionPool.
    2)According to the user privileges i need access the database tables
    content and gives the frontEnd(jsp).
    3)How to modify dynamically weblogic.properties file in the weblogic
    5.1.
    If anybody having idea reg. this issues pl...help me..
    Thanks in advance
    Chandu([email protected],[email protected])

  • Multi user catalog and how to make it - use a checked out system

    Lots of people want or need a Multi user ability in lightroom here is one way to achieve multi-user catalogs by using a check-in check-out system.
    The Catalog would open normally upon a second user opening LR would then ask to switch to multi-user mode.
    Once in multi user mode lightroom would lock-out images, collections, or folders by a checked-out for editing system.
    By checking-out images, collections, or folders: files would be unavailable to other users until edits are saved, and the images, collections, or folders are checked-in.
    This check-in check-out system would need a global check-in feature in case someone forgot to check in an image, collection, or folders (global check-in could be admin level). Word documents, CAD files, etc, use a similar lock-out/read only system for the files. Since, we wouldn't want to bloat the files with programing to lock out the files, this would have to be added to the catalog and managed by the catalog.
    My system
    Vista Ultimate 32bit SP1
    AMD 64X2 duel core 6000+ 3.2Ghz
    6GB 666mhz Ram PAE force enabled
    NVIDIA Gforce 7600 256MB video card (1.75GB total with system shared ram)
    primary hard drive 500GB
    Hard drive 2 400GB (system and photoshop paging files and lightroom catalog drive)
    Hdrive 3 1TB (primary image storage)
    user control turned off
    system graphics set to performance
    Duel display
    LR 2.0
    PS extended CS3

    Your thread pool is a pool and probably keeps
    the thread alive even though the thread has nothing
    after a minute toi execute - you'll have to call its
    shutdown() methodThanks Oxe...
    I googled that (easy when you know what the answer is) and yes the ScheduledThreadPool retains threads for re-use, so you have to check that all threads are done and then shutdown() the scheduler... like this:     while (!future.isDone()) {
              try { Thread.sleep(10); } catch(InterruptedException e) {}
         scheduler.shutdown();
    ... here is the complete working class:
    import java.util.concurrent.ScheduledExecutorService;
    import java.util.concurrent.Executors;
    import java.util.concurrent.ScheduledFuture;
    import static java.util.concurrent.TimeUnit.*;
    import java.awt.Toolkit;
    class BeeperControl {
         private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
         public void beepForAMinute() {
              final Toolkit tk = Toolkit.getDefaultToolkit();
              final Runnable beeper = new Runnable() {
                   public void run() {
                        tk.beep();
                        System.out.println("beep");
              final ScheduledFuture<?> future = scheduler.scheduleAtFixedRate(beeper, 250, 250, MILLISECONDS);
              scheduler.schedule(
                   new Runnable() {
                        public void run(){
                             future.cancel(true);
                   }, 3, SECONDS
              while (!future.isDone()) {
                   try { Thread.sleep(10); } catch(InterruptedException e) {}
              scheduler.shutdown();
         public static void main(String[] args)
              BeeperControl bc = new BeeperControl();
              bc.beepForAMinute();
    }Thanx again. Keith.

  • How to send one email to multi-users using JavaMail ?

    I am using JavaMail API. I am working in "sending emails to users", I had already tested "one email to one user" and got success but when tried to send one email to multi-users then I failed to do that?
    Can anyone help me to do this?
    I have used the below code to send to multi-user:
    Address[] toAddr = {new InternetAddress(_to),new InternetAddress (to2)};
    msg.addRecipients(Message.RecipientType.TO, toAddr);
    But it is static only 2 users. I want to send to multi-users dynamically taking datas from database.
    I have tried by using below code but it doesn't work.....
    InternetAddress[] emails;
    while (resultset.next()) {
    temp = resultset.getString(1);
    emails.setAddress(temp);
    i++;
    Address[] toAddr = emails;
    msg.addRecipients(Message.RecipientType.TO, toAddr);
    Thank you in advance...
    -ritesh

    I think you're confused about some basic Java programming techniques.
    There are two obvious ways to do this.
    1. Call the addRecipient method in a loop.
    2. Collect all the recipients in a List, convert it to an array, and call addRecipients.

  • Windows XP: multi-user accounts - one works, another doesnt!

    Hi all,
    I have installed the JRE many a time, but never on an XP machine with multi-user accounts...
    my problem is that a jar file I have will run on one XP account, while the other account won't run, I just get Null Pointer Exceptions if i try to run it using "java -jar myApp.jar" or a Fatal Error JVM error if I double click the jar.
    Any ideas? I tried installing the JRE from both user accounts, but no luck. Please help! :(
    Scott

    edit: sorry guys, n/m..it wasn't a JRE issue after all :)

  • File structure and Multi-user access/control

    Hi All
    Currently evaluating RH. Our plan is to use RH HTML with RoboServer and either SourceSafe or Team Foundation for source control. We will be producing the "printed" manual (PDF) and publishing online help (hopefully html via RH server) from the single source layout
    Given that we will edit content in RH's XHTML editor, I'm not clear on when we should create new files or the granularity of multi-user access. We have 17 apps and I plan to use a master project and merging (because we need to link to related topics in other apps).
    I'm really not sure what should constitute a file in RH. First off, is access controlled at the file level?
    I want to have multiple authors editing the same manual at the same time, so do I need to break the manual into multiple small files (currently it's a single word doc)?
    If I do break it into multiple files, what's the best approach: 1 file per topic (or is this a requirement)?
    Finally, when I come to generate the PDF, will the files be combined. (i.e. can I have different page-breaks than I have in the RH project)?
    Any pointers greatly appreciated
    Regards
    Mark

    Hi,
    First off, is access controlled at the file level?
    Not sure what you mean by that. In source control, you can check in/out ever file independent. Sometimes dependent files will be automatically checked out, for instance images used in the css when you check out the style sheet.
    I want to have multiple authors editing the same manual at the same time, so do I need to break the manual into multiple small files (currently it's a single word doc)?
    That be the idea. Anyway, it's not a good idea to have an entire RoboHelp project in a single topic. You probably want to cut up your contents into the small chunck: topics.
    If I do break it into multiple files, what's the best approach: 1 file per topic (or is this a requirement)?
    In RoboHelp a topic is a HTML file. RoboHelp doesn't force you to split up content into one or more topics. If you are creating help for the web, you want the information to be organized in relatively small chunck so users can quickly scan through it.
    Finally, when I come to generate the PDF, will the files be combined. (i.e. can I have different page-breaks than I have in the RH project)?
    Not sure what you mean by page breaks. As RoboHelp creates HTML files, there are no page breaks such as in paper manuals. When you create a PDF, you combine the topics you need into a single document.
    If a PDF is required for you, you may want to consider not using RoboHelp for your sources. A PDF created by RoboHelp is useful for internal use, but it never seems to get good enough to give to customers. Personally, when a PDF version of a manual is required, I create the manual in FrameMaker and link or import the book into RoboHelp. You can also link Word documents, so you may want to play around with that before deciding whether to use Word, RoboHelp or FrameMaker for your source.
    Greet,
    Willam

Maybe you are looking for

  • Printing to my Windows Networked Printer from my MacBook

    Let me apologize upfront, I'm new the world of Apple, just coming over from the PC world and so these will surely be stupid questions. I just got a new MacBook (which I LOVE!!!) I have a Desktop PC running XP I have an HP OfficeJet G85 connected by U

  • Can't install ConfigFree on Windows 7

    HI, I've been trying to install the configfree utility, but it stops displaying an error "service installation" related. I have tryed all the option available, that I know of, such as rua as an administrator, enabeling the administrator account, chan

  • HT5691 How long do I have to purchase applecare

    Buying a iPad for my daughter do I need to get the AppleCare now or can I get it after Christmas when she first registers it?

  • Nokia 6234 Network Problem

    I have an unlocked 6234. When I insert my Orange SIM and turn it on, it takes a while before recognizing the operator which is not normal. When I insert a Vodafone SIM, it instantly recognize the operator. I have it from a friend from a village. In t

  • Re: [request] latest vbios R9 290 gaming 4G

    ok, i'll contact LDLC then and if they don't want to accept, i'll try msi thanks for the help