MySQL - Transactions without locks?

Hi , I am using the native transaction support of mysql innodb ( setautocommit(false) etc etc).
I also want to have multiple connections to the database which are able to update the same rows etc. - -now the error I'm getting is 'lock wait timeout'.
Probably this forum is not the exact place for this question, but is there any way of unlocking the rows? ie i start a transaction, insert some row, then want another connection/transaction to be able to update that row - and then commit or rollback either transaction I feel like. Timeout is not a solution as i want overlapping transactions.
This might sound mad/bad but please don't reply telling me its dangerous etc etc
Any help much appreciated,
thanks

Hi , I am using the native transaction support of
mysql innodb ( setautocommit(false) etc etc).
I also want to have multiple connections to the
database which are able to update the same rows etc.
- -now the error I'm getting is 'lock wait timeout'.
Probably this forum is not the exact place for this
question, but is there any way of unlocking the rows?
ie i start a transaction, insert some row, then want
another connection/transaction to be able to update
that row - and then commit or rollback either
transaction I feel like. Timeout is not a solution
n as i want overlapping transactions.
As far as I know, no database does overlapping transactions. (I suspect that either it is not feasible or it would have a huge performance impact. Or both.)
So your choice is either to live with the locks or stop using explicit transactions and write one row at a time.

Similar Messages

  • Re: Transactions and Locking Rows for Update

    Dale,
    Sounds like you either need an "optimistic locking" scheme, usually
    implemented with timestamps at the database level, or a concurrency manager.
    A concurrency manager registers objects that may be of interest to multiple
    users in a central location. It takes care of notifying interested parties
    (i.e., clients,) of changes made to those objects, using a "notifier" pattern.
    The optimistic locking scheme is relatively easy to implement at the
    database level, but introduces several problems. One problem is that the
    first person to save their changes "wins" - every one else has to discard
    their changes. Also, you now have business policy effectively embedded in
    the database.
    The concurrency manager is much more flexible, and keeps the policy where
    it probably belongs. However, it is more complex, and there are some
    implications to performance when you get to the multiple-thousand-user
    range because of its event-based nature.
    Another pattern of lock management that has been implemented is a
    "key-based" lock manager that does not use events, and may be more
    effective at managing this type of concurrency for large numbers of users.
    There are too many details to go into here, but I may be able to give you
    more ideas in a separate note, if you want.
    Don
    At 04:48 PM 6/5/97 PDT, Dale "V." Georg wrote:
    I have a problem in the application I am currently working on, which it
    seems to me should be easily solvable via appropriate use of transactions
    and database locking, but I'm having trouble figuring out exactly how to
    do it. The database we are using is Oracle 7.2.
    The scenario is as follows: We have a window where the user picks an
    object from a dropdown list. Some of the object's attributes are then
    displayed in that window, and the user then has the option of editing
    those attributes, and at some point hitting the equivalent of a 'save'button
    to write the changes back to the database. So far, so good. Now
    introduce a second user. If user #1 and user #2 both happen to pull up
    the same object and start making changes to it, user #1 could write back
    to the database and then 15 seconds later user #2 could write back to the
    database, completely overlaying user #1's changes without ever knowing
    they had happened. This is not good, particularly for our application
    where editing the object causes it to progress from one state to the next,
    and multiple users trying to edit it at the same time spells disaster.
    The first thing that came to mind was to do a select with intent to update,
    i.e. 'select * from table where key = 'somevalue' with update'. This way
    the next user to try to select from the table using the same key would not
    be able to get it. This would prevent multiple users from being able to
    pull the same object up on their screens at the same time. Unfortunately,
    I can think of a number of problems with this approach.
    For one thing, the lock is only held for the duration of the transaction, so
    I would have to open a Forte transaction, do the select with intent to
    update, let the user modify the object, then when they saved it back again
    end the transaction. Since a window is driven by the event loop I can't
    think of any way to start a transaction, let the user interact with the
    window, then end the transaction, short of closing and re-opening the
    window. This would imply having a separate window specifically for
    updating the object, and then wrapping the whole of that window's event
    loop in a transaction. This would be a different interface than we wanted
    to present to the users, but it might still work if not for the next issue.
    The second problem is that we are using a pooled DBSession approach
    to connecting to the database. There is a single Oracle login account
    which none of the users know the password to, and thus the users
    simply share DBSession resources. If one user starts a transaction
    and does a select with intent to update on one DBSession, then another
    user starts a transaction and tries to do the same thing on the same
    DBSession, then the second user will get an error out of Oracle because
    there's already an open transaction on that DBSession.
    At this point, I am still tossing ideas around in my head, but after
    speaking with our Oracle/Forte admin here, we came to the conclusion
    that somebody must have had to address these issues before, so I
    thought I'd toss it out and see what came back.
    Thanks in advance for any ideas!
    Dale V. Georg
    Indus Consultancy Services [email protected]
    Mack Trucks, Inc. [email protected]
    >
    >
    >
    >
    ====================================
    Don Nelson
    Senior Consultant
    Forte Software, Inc.
    Denver, CO
    Corporate voice mail: 510-986-3810
    aka: [email protected]
    ====================================
    "I think nighttime is dark so you can imagine your fears with less
    distraction." - Calvin

    We have taken an optimistic data locking approach. Retrieved values are
    stored as initial values; changes are stored seperately. During update, key
    value(s) or the entire retieved set is used in a where criteria to validate
    that the data set is still in the initial state. This allows good decoupling
    of the data access layer. However, optimistic locking allows multiple users
    to access the same data set at the same time, but then only one can save
    changes, the rest would get an error message that the data had changed. We
    haven't had any need to use a pessimistic lock.
    Pessimistic locking usually involves some form of open session or DBMS level
    lock, which we haven't implemented for performance reasons. If we do find the
    need for a pessimistic lock, we will probably use cached data sets that are
    checked first, and returned as read-only if already in the cache.
    -DFR
    Dale V. Georg <[email protected]> on 06/05/97 03:25:02 PM
    To: Forte User Group <[email protected]> @ INTERNET
    cc: Richards* Debbie <[email protected]> @ INTERNET, Gardner*
    Steve <[email protected]> @ INTERNET
    Subject: Transactions and Locking Rows for Update
    I have a problem in the application I am currently working on, which it
    seems to me should be easily solvable via appropriate use of transactions
    and database locking, but I'm having trouble figuring out exactly how to
    do it. The database we are using is Oracle 7.2.
    The scenario is as follows: We have a window where the user picks an
    object from a dropdown list. Some of the object's attributes are then
    displayed in that window, and the user then has the option of editing
    those attributes, and at some point hitting the equivalent of a 'save' button
    to write the changes back to the database. So far, so good. Now
    introduce a second user. If user #1 and user #2 both happen to pull up
    the same object and start making changes to it, user #1 could write back
    to the database and then 15 seconds later user #2 could write back to the
    database, completely overlaying user #1's changes without ever knowing
    they had happened. This is not good, particularly for our application
    where editing the object causes it to progress from one state to the next,
    and multiple users trying to edit it at the same time spells disaster.
    The first thing that came to mind was to do a select with intent to update,
    i.e. 'select * from table where key = 'somevalue' with update'. This way
    the next user to try to select from the table using the same key would not
    be able to get it. This would prevent multiple users from being able to
    pull the same object up on their screens at the same time. Unfortunately,
    I can think of a number of problems with this approach.
    For one thing, the lock is only held for the duration of the transaction, so
    I would have to open a Forte transaction, do the select with intent to
    update, let the user modify the object, then when they saved it back again
    end the transaction. Since a window is driven by the event loop I can't
    think of any way to start a transaction, let the user interact with the
    window, then end the transaction, short of closing and re-opening the
    window. This would imply having a separate window specifically for
    updating the object, and then wrapping the whole of that window's event
    loop in a transaction. This would be a different interface than we wanted
    to present to the users, but it might still work if not for the next issue.
    The second problem is that we are using a pooled DBSession approach
    to connecting to the database. There is a single Oracle login account
    which none of the users know the password to, and thus the users
    simply share DBSession resources. If one user starts a transaction
    and does a select with intent to update on one DBSession, then another
    user starts a transaction and tries to do the same thing on the same
    DBSession, then the second user will get an error out of Oracle because
    there's already an open transaction on that DBSession.
    At this point, I am still tossing ideas around in my head, but after
    speaking with our Oracle/Forte admin here, we came to the conclusion
    that somebody must have had to address these issues before, so I
    thought I'd toss it out and see what came back.
    Thanks in advance for
    any
    ideas!
    Dale V. Georg
    Indus Consultancy Services [email protected]
    Mack Trucks, Inc. [email protected]
    ------ Message Header Follows ------
    Received: from pebble.Sagesoln.com by notes.bsginc.com
    (PostalUnion/SMTP(tm) v2.1.9c for Windows NT(tm))
    id AA-1997Jun05.162418.1771.334203; Thu, 05 Jun 1997 16:24:19 -0500
    Received: (from sync@localhost) by pebble.Sagesoln.com (8.6.10/8.6.9) id
    NAA11825 for forte-users-outgoing; Thu, 5 Jun 1997 13:47:58 -0700
    Received: (from uucp@localhost) by pebble.Sagesoln.com (8.6.10/8.6.9) id
    NAA11819 for <[email protected]>; Thu, 5 Jun 1997 13:47:56 -0700
    Received: from unknown(207.159.84.4) by pebble.sagesoln.com via smap (V1.3)
    id sma011817; Thu Jun 5 13:47:43 1997
    Received: from tes0001.macktrucks.com by relay.macktrucks.com
    via smtpd (for pebble.sagesoln.com [206.80.24.108]) with SMTP; 5 Jun
    1997 19:35:31 UT
    Received: from dale by tes0001.macktrucks.com (SMI-8.6/SMI-SVR4)
    id QAA04637; Thu, 5 Jun 1997 16:45:51 -0400
    Message-ID: <[email protected]>
    Priority: Normal
    To: Forte User Group <[email protected]>
    Cc: "Richards," Debbie <[email protected]>,
    "Gardner," Steve <[email protected]>
    MIME-Version: 1.0
    From: Dale "V." Georg <[email protected]>
    Subject: Transactions and Locking Rows for Update
    Date: Thu, 05 Jun 97 16:48:37 PDT
    Content-Type: text/plain; charset=US-ASCII; X-MAPIextension=".TXT"
    Content-Transfer-Encoding: quoted-printable
    Sender: [email protected]
    Precedence: bulk
    Reply-To: Dale "V." Georg <[email protected]>

  • Cannot connect on OWB - "started new global transaction without ending..."

    Hi, folks.
    I had to change my computer and reinstall my OWB 11.1.0.6.0 in my PC (Windows 7 64b), but thus far I couldn't connect to OWB and we don't really know what to do here.
    We've been experiencing these following mistakes:
    "PRS-00322: Internal Error: started new global transaction without ending existing global transaction. Please contact Oracle Support with the stack trace and details on how to reproduce it".
    "API5022: It's not possible to establish connection with the specified account. Check out the connection information".
    Do I have to change something on the TNSNAMES.ora or something like this?
    Thanks for your help

    have u tried this
    alter system session kill immediate""..
    else
    login as sys and check status of OWB design user...see if that is locked
    or at last
    if possible reboot the database server

  • How do you hide one dimension from EPM context pane without locking it

    Hi Experts,
    Simple question: How can I programmatically (using vba) hide a particular dimension in the EPM context pane, without locking it?
    Following API's could be used, but they all have have a mandatory parameter for the dimension member... which locks the dimension... but I need it to stay unlocked!
    SetContextMember
    SetContextOptions
    SetContextOptionsForSeveralDimensions
    And no, I do not want to use the User option to hide the full context pane.
    Thanks for your advice.

    Hi,
    You can use Hide option to just hide required dimensions with out locking.
    EPM-->Options-->Context Options.
    Thanks,
    Raju

  • Lost Mode and Play Sound are "Pending."  However, iCloud indicates that it connected and backed up to iCloud at a date that is 1 week after it went missing.  How is this possible without locking (Lost Mode Pending an internet connection)

    Hi,
    My wife lost her iPhone two weeks ago while on vacation in London (cell service inoperative in foreign country).  Using Find My iPhone app on my device, I activated Lost Mode and Play Sound.  However, both are listed as "Pending," since it those actions require the phone to connect to the internet (wifi only due to no cellular data coverage.).
    We recently returned home and purchased a new iPhone.
    However, when looking to restore the apps/settings from her old phone using a previous iCloud backup, iCloud indicates that the old phone connected to iCloud and backed up the original phone at a date that is 1 week after it went missing.  How is this possible without locking (Lost Mode Pending an internet connection)?
    If the phone was activated and connected to the internet via a wifi signal, shouldn't it immedately lock, show up on the map, Play Sound, and send me an email that the phone has been found?
    I also read somewhere that if running iOS 7, the iCloud website interface enables you to track previous locations, for instance if the phone moves from wifi hotspot to hotspot.  Is that true?  If so, how do I do that?
    Thank you for your time, and have a great day!
    Sincerely,
    - Matt

    just giving this a wee bump as time is of the essence here and i need advice/ answers quick!
    apologies if i've broke any rules!
    alex

  • Why won't my Mac Pro load things without locking up ?

    Why won't my Mac Pro load things or let me do a "save as" without locking up ? I have tried to run the Apple Hardware Test and it locks up as well.

    you have anitebook in forum for 65lbs towers
    youneed to repair your disk directory or erase and restore
    and use Recovery Mode in 10.7 and later
    AHT does not lick up, not unless your laptop RAM or mobo has failed totally and died, more common for laptops that overheat, sufferwater damage, but still...
    depends on how new what to do, might try macbookmpro forum.

  • ALSB 3 roll back a transaction without sending a fault message

    Hi,
    I have a proxy service exposed as a web service, which has some operations that call some tuxedo systems, do some transformation of the data, etc.
    When any of it's operations is invoked I have to build an XML reply in both success AND error cases. The difference between both is a response code, if the call to the backend tuxedo system responded with a stream that starts with OK then everything is fine and I build the reply and send it back, but if an error ocurred it will send back an stream that starts with ER followed by an error code, with which I will have to build the SAME XML but using this error code and send it back to the client instead as a "successful" invocation instead of sending a SOAP fault message. Also I need to roll back the whole transaction in that error case. The system works like that and it can't be changed, we are building this proxy service based on a WSDL file given to us by the partner company that invokes our service and there's lots of other clients that do it in the same way. The problem is that I haven't found a way to roll back the transaction without making the proxy service send a fault message that the client system won't understand. The "Raise error" and "Reply with failure" do roll back the transaction but both send a fault message. Is there a way to answer "successfully" to the client but make an explicit rollback?

    Hi,
    Check the blog http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/22017.. [original link is broken] [original link is broken] [original link is broken]
    You can handle the exception on your web service and model a Notification task so that you can send e-mail notification to the sender in case of exception
    Regards, Anil

  • How can I protect formulae in a newly created spreadsheet without locking the whole sheet ?

    How can I protect formulae from being overwritten on a newly created spreadsheet without locking the whole sheet ?

    Olly,
    I'll be picky here on nomenclature ;-)
    Tables and other Obects can be locked, but Sheets can't be locked.
    If you wish to shield some parts of your content from accidental modification, arrange your layout to put that sensitive content in tables separate from the tables that need to be accessed, and lock the sensitive ones. It's also possible, but rather clunky, to place shields over the sensitive area. A shield can be made by Inserting a Shape and positioning the shape over the sensitive area. With the shape selected, go to the Graphics Inpector and set the Opacity of the shape to zero. You will then be able to see through the shape but will no be able to Click through it to get at the cells below. This method is inconvenient because you have to worry about keeping the shape aligned with the table should the table need to change size or shape.
    Jerry

  • Call an MM transaction without creating a new LUW

    Hello Experts,
    I have created a new Z_ transaction in which I want to call an existing Materials Management
    transaction (MB1B). Additionally, in my transaction I update some extra custom (z_) tables. I would like to have one LUW so as to perform all updates (both custom tables and SAP tables updated by the MM transaction) together at the final "commit work" in my program.
    Is there a way to call the MM transaction without creating a new LUW in my calling program (as the CALL TRANSACTION statement does)?
    I have read that one way is to use the CALL DIALOG statement instead. Is it a safe method to use?
    Please give as much detailed info (with examples) as possible.
    Thank you very much in advance,
    Orestis

    Hi Sandra,
    My requirement is to call a transacton in a subscreen. Created a screen 100 that is devided into 2 one for custom container to place tree control and  another for subscreen that is to call transaction.
    Call transaction works fine, but this transaction is being opened in new screen(as each transaction use new LUW)., is there any to display the transaction in the sub screen area instead of new screen..
    For ex, very similar to t-code SE80. In se80, choose other object, and choose more, and select trasaction  and enter any t-code, then it displays same of SE93 in the right side of the screen...hope it is clear..
    Regards, Laks

  • IS IT POSSIBLE TO CREATE TRANSACTION WITHOUT USING ACTION BOX?

    HI,
    We are trying to implement CIC NON-TELEPHONY.
    Our requirment is simple we need to create complaint from CIC.
    Is it possible to create a transaction without calling it from action box using default workspaces.
    I mean i will not configure action box at all all i do is create a default work space for complaint which appears when the CIC screen is called up.
    Is it really possible to create this way or is it mandatory that the transaction should be called from action box only to create it?
    Can some one please advice on this we just need to create a couple of transactions from CIC 'cause we are planning to set up a small call centre.
    Though i am not sure of the way it needs to be created i tried to create it with default workspaces ( i mean i did not call it from the action box) but the problem is while i create the transaction in this way i have a problem with partner determination and organization determination they are wrongly determined.
    So, i need to confirm is this way of creating acceptable.
    Awaiting suggestions
    Regards,
    SAM

    Hi Sam,
    As far as I know, the way that you use the Default workspace(Business Activity) with the transaction type as Complaint should be fine. There is no hard and fast rule to only create the Complaints in CIC via Action Box.
    Pertain to the Partner / Org. Determination, when you launch CIC, then as per the configuration, the default workspace(Business Activity) of the transaction type Complaint will be used and at this very begining itself the partner determination(associated with the transaction type) will be executed. And this is what you can see in the workspace as well.
    When you confirm a BP, then as per the customizing maintained in the transaction CRMC_CIC_SEARCH_RULE("Profiles for contact search"), the BP1 and BP2 partner functions will be pushed into the Activity you made as default for the interaction.
    This is how the CIC - with Business Activities & Partner Functions will work. I guess, apart from the way that you had made the default workspace of the transaction type as Complaint, you can also have a look at the above mentioned transaction for Contact searches and according to your need you can change the partner functions.
    Hope this information helps !
    With Best Regards,
    Vinod

  • End transaction without saving it

    Hi All
    A. Is there any possible with a button standard sap, to get out from a document
    transaction without saving it? after confirm account? (i am not working with IVR)
    B. Is there any possible to get out from document transaction without
    saving the changes even i made change.
    for example:
    1.Navigate to the INBOX
    2.Chosse transaction: press the link.
    3.Press change button
    4.Now lets say that i made some change and then i understand that is is
    a mistake. How can i get out without saving this changes.
    In the win guy or PCUI there is a pop up asked you to save or not. in The ICWeb
    I know there are no pop ups.
    Any sugested
    Did someone deal with such request?
    Thanks
    Merav

    Method:
    CL_GUI_FRONTEND_SERVICES->REGISTRY_GET_VALUE(
    ROOT = 1
    KEY = Software\Microsoft\Windows NT\CurrentVersion\Windows
    VALUE = Device

  • Message Error: 10 (Transaction without Amount)

    Hi Experts,
    When i am running depreciation run this error is occurring every time. Although the financial impact of depreciation does occur. Kindly let me know how can i solve this error.
    Kind Regards,
    Ozair Shamsi

    HI,
    Check below threads:
    Fixed Assets - Depreciation Run - Error -10 (Transaction Without Amount)
    Transaction without amount
    aldo check SAP Note 1166310
    Thanks,
    neetu

  • Can I password protect my mail, SMS, and phone mess. without locking the whole iphone?

    Hi - I am trying to figure out if there is a way to keep my email, MSM's and phone messages protected without locking the entire phone.  My son likes to play with the apps and others may pick it up to surf the net, which I don't mind, I just don't want them to be able to look at all of my stuff.  Thx

    No, it's all or nothing. Sorry.

  • HT201304 I need to restrict access to Settings on an iPad so settings like VoiceOver cannot be activated while letting them access multiple apps on the device. Is their any way to restrict access to settings without locking the device with a PIN?

    I need to restrict access to Settings on an iPad so settings like VoiceOver cannot be activated while letting them access multiple apps on the device. Is their any way to restrict access to settings without locking the device with a PIN?
    This is so our guests cannot tamper or disable the device. We are already using Apple Configurator but their does not seem to be a way to lock down settings without a PIN.

    There's a lot of restrictions information in Chapter 19 of the 4.2 User Guide.
    http://support.apple.com/manuals/#ipad
    By the way, a more extensive version of the User Manual is available at no charge through iBooks.

  • Executing transaction without active Undo Tablespace

    Hi,
    DB: 9.2.0.5
    OS : AIX 5.2
    I have opened my standby database in READ ONLY mode.I have undo tablespace.It is live setup and users are checking data with standby database.
    SQL> show parameter aq_tm
    NAME TYPE VALUE
    aq_tm_processes integer 0
    SQL>
    SQL> show parameter undo
    NAME TYPE VALUE
    undo_management string AUTO
    undo_retention integer 10800
    undo_suppress_errors boolean FALSE
    undo_tablespace string UNDOTBS1
    SQL>
    My standby alertlog getting warning message as
    Mon Dec 13 12:16:39 2010
    ***Warning - Executing transaction without active Undo Tablespace
    Mon Dec 13 12:27:37 2010
    ***Warning - Executing transaction without active Undo Tablespace
    Mon Dec 13 12:28:03 2010
    ***Warning - Executing transaction without active Undo Tablespace
    Mon Dec 13 12:28:17 2010
    ***Warning - Executing transaction without active Undo Tablespace
    Mon Dec 13 12:34:43 2010
    ***Warning - Executing transaction without active Undo Tablespace
    ***Warning - Executing transaction without active Undo Tablespace
    ***Warning - Executing transaction without active Undo Tablespace
    ***Warning - Executing transaction without active Undo Tablespace
    ***Warning - Executing transaction without active Undo Tablespace
    ***Warning - Executing transaction without active Undo Tablespace
    ***Warning - Executing transaction without active Undo Tablespace
    ***Warning - Executing transaction without active Undo Tablespace
    ***Warning - Executing transaction without active Undo Tablespace
    ***Warning - Executing transaction without active Undo Tablespace
    ***Warning - Executing transaction without active Undo Tablespace
    Mon Dec 13 12:35:22 2010
    ***Warning - Executing transaction without active Undo Tablespace
    ***Warning - Executing transaction without active Undo Tablespace
    Please help me.
    Thanks,
    sunand

    Hi Forstmann,
    Thanks for your quick reply.
    I have temp tablespace and see the below output.
    SQL> select name from v$tempfile;
    no rows selected
    Which means i do not have any temp file to temp tablespace.
    How do i can create tempfile in standby?.In what following states i can create,
    1) MOUNT ( Recovery mode canceled)
    2) READ ONLY
    3) opened after FAILOVER
    4) At any stage i can
    My client is planning to check the DR server by doing FAILOVER.After that will create standby database again from primary.
    Thanks,
    Sunand

Maybe you are looking for