Howto implement hand-rolled locking with SQL?

Hi there,
For now I used java.util.Concurrent's classes for locking critical sections which should only be modified/read by a client at a time. However now one customer would like to cluster our app and I wonder wether the locking could also be done with SQL.
The reason why we don't use some high-level SQL constructs is that our product only uses a really very small subset of SQL.
Any ideas wether/how double-checked locking could be implemented using SQL?
Thank you in advance, lg Clemens

Here is a link to a nice discussion on your topic.
It might or might not help, but it did appear
pertinent to your questions by talking about
alternative methods and pros and cons of
auto-incrementing.Ooooh are we back on this topic again? Delightful. And just in time for the holiday when I shall have the time to compose lengthy replies on the subject.
Since the last time this subject came up (and I recall having some discussion with duffymo about it) I have been doing further thinking about it all and here are my thoughts.
Design Stage
A bit of a rehash of what I said before. I think it is key during the database (note database and not application) design phase to design without using auto-generated keys. Your database integrity, that is the integrity of each table and the integrity of each relationship between tables must be able to "stand up" without the use of these keys.
In general proper database design is, I believe, a learned craft. Since the amount of poor designs, at least what I come across, seems so prolific I think a good rule of thumb would be to apply the above rule to one's design stringently as a good practice that will create proper designs.
Creation and Deployment Phase
When you have a solid design then before creating and deploying the database design is a good time to look at where generated keys might be appropriate. Generally speaking I recommend using them for the following reasons
1) Ease of development. Let's face it joining key to key on an numeric column is much easier than joining on multiple variable columns.
2) Performance. The time to access a multiple key field with variable length columns is going to be different than a single key numeric field. Now this item was refuted in the article WorkForFood linked above but I think there is an issue to consider here all the same. It all depends on the usage.
I will certainly give you that database indexes are wonderful things and in most cases the performance differences between searching by a multiple column key vs a single column key are going to be hardly measurable. But what about updating? And what about the size of your table.
If the database is small or the database is largely for analysis and reporting then performance is (probably) not going to be an issue. However for a large scale transaction database I think one would be foolish to dismiss the performance impact out of hand.
3) Long-term flexibility. This was a point raised by duffymo in the last go around and it's certainly worth considering. The general theory is this, when you use non-generated keys you are locking business logic into your database design. If you need to make changes later for business reasons you are up the proverbial creek.
Personally, while I think the point is valid I am not overly sold on this one. I think there is only so much "planning against future changes" that one can and should do. I would rather see the needs of the current design met in an effective fashion before considering this. So I guess to me if all other things are equal this a reason to use generated keys.
Rules for Using Generated Keys
The two rules I would like to see people use when using generated keys are as follows.
1) Always create a constraint on the real key. Again and again I encounter systems where this has not been done. You might as well not have any keys at all with this kind of disaster. If you can't create a constraint then I think you have to go back to the design stage and rethink this.
2) Never use generated keys when one or more foreign keys form part of the primary key. Really this advice applies exclusively to tables that form many-to-many relationships. Auto-generated keys should never ever be used in tables like this. It's just a mess waiting to happen.
Of course the key could be several foreign keys that are each auto-generated keys in their own tables...
Other stuff I am going to refute in the linked article that doesn't fit anywhere else
Well mainly I don't like the concept of application generated keys. Which is discussed in some of the replies. To me that is a mix of all the cons of using generated keys and the cons of using natural keys all at the same time while adding a new level of stuff tied into your application logic that will make life more difficult in the end. I just don't like it.

Similar Messages

  • "Photos in the Camera Roll of "(your) iPhone" cannot be imported because the device is locked with a passcode.  You must unlock the device to import them."  My iPhone 5 running the latest iOS 7.1 and I'm using iPhoto '11 v 9.4.3

    "Photos in the Camera Roll of "(your) iPhone" cannot be imported because the device is locked with a passcode.  You must unlock the device to import them."  That's the new error message when I plug in my iPhone 5 running the latest iOS 7.1 into the MacBook Pro running iPhoto '11 v.9.4.3.  My Mac OSX is still 10.8.5.
    So, I unlock the iPhone by entering the "passcode" before I plug it into the MBP and still iPhoto does nothing.  At least it doesn't issue the error message above.
    I've checked both iPhoto preferences and those for Photos and Camera in the Settings on the iPhone.  There doesn't seem to be anything to change this lack of connectivity.
    What next please?

    An hour-long phone discussion with Apple Support yesterday solved this question and sorted a couple of others.
    As for this one, do not ignore any messages which pop up when you plug in your iPhone and ask "Trust this computer?".  The correct reply is "Yes", not "Cancel".
    OK, you cancelled like I did, thinking "What on earth is this for?".  Mistake.  You can force the issue by having iTunes open when you next plug in your iPhone.  Tell the iPhone that it can trust its old friend, your computer and voila!  Your photos can download into iPhoto again.
    Thank you, Jay with Apple Sydney, Australia!

  • Photos in the camera roll of "iPhone cannot be imported because the device is locked with a passcode.  Tried just about everything - suggestions?

    Photos in the camera roll of "iPhone cannot be imported because the device is locked with a passcode.  Tried just about everything - suggestions?

    Because your computer sees your phone, as it would see any digital camera, as long as you have photos in your camera role. Since you state you don't sync with this computer & have a passcode on your phone, that's why you get that message. The only way to prevent that message is either start syncing with this computer; remove the photos from your camera roll prior to connecting; or first turn off your passcode before you connect. Either that, or you live with it.
    You shouldn't be storing photos in your camera roll anyway. iPhone camera roll is not designed for photo storage. You should be regularly importing them.

  • How to disable the message that pops up every time i connect my iphone "photos in the camera roll of iphone cannot be imported because the device is locked with a passcode"?

    Wrongly posted in iPhoto forum, should probably be posted here instead.
    I want to remove the message that pops up every time i connect my IPhone that says: "Photos in the Camera Roll of "Name" cannot be imported because the device is locked with a passcode.".
    This computer is not one that I want to import photos to (or sync with the iPhone), so this message is just very annoying, and it pops up all the time. I cannot find a way to disable this message. It is constantly appearing. No application is launching, I have turned off the iPhoto launch in the Image Capture app as well as in iPhoto. Thanks in advance if anyone has any information about this.

    Because your computer sees your phone, as it would see any digital camera, as long as you have photos in your camera role. Since you state you don't sync with this computer & have a passcode on your phone, that's why you get that message. The only way to prevent that message is either start syncing with this computer; remove the photos from your camera roll prior to connecting; or first turn off your passcode before you connect. Either that, or you live with it.
    You shouldn't be storing photos in your camera roll anyway. iPhone camera roll is not designed for photo storage. You should be regularly importing them.

  • They have a symbol that is on the top right hand corner and don't know what it is for .. It's a little lock with a circle around it.. Can u help me please???

    I have a symbol on the top right hand corner and don't know what it is!! It's a little lock with a circle around it??  Help please???

    It's Orientation Lock, which will kee the screen from rotating when you rotate the device.
    It's accessible from Command Center- swipe up from the bottom of the screen.  You should see the icon to turn Orientation Lock on or off.

  • Photos in the Camera Roll on "iPhone 4S" cannot be viewed because the iPhone is locked with a passcode

    Having just updated to the latest system 6.0 (10A403) Everytime when I connect my Iphone to my Mac and open iphoto with the phone connected, a warning window keeps popping up. Showing "Photos in the Camera Roll on "iPhone 4S" cannot be viewed or imported because the iPhone is locked with a passcode."
    But it is not locked. The rest of the synch in iTunes seems to work fine but iPhoto says that there are no photos for importing, when thjere are many. Any assistance most appreciated. thanks

    Reenable the password and then disable it. The message should no longer appear.

  • Camera Roll on iphone is locked with a passcode

    I am getting this screen whenever I connect my Iphone to my Mac. When I open up Iphoto with or without a phone connected, this shows up.
    Photos in the Camera Roll on "Iphone 4" cannot be viewed or imported because the iPhone is locked with a passcode.
    Something is wrong with my Iphoto, how do I fix it?

    Hi,
    Help for Passcodes here.
    Carolyn 

  • HT4061 i cant activate my iphone 5c because it has been locked with a different apple id. i dont know the original owner so i need help. its a second-hand phone that i bought some months back

    i cant activate my iphone 5c because it has been locked with a different apple id. i dont know the original owner so i need help. its a second-hand phone that i bought some months back

    Unfortunately, there is pretty much nothing you can do. Only the owner of the account used to lock it can remove the lock. If you can't contact whoever you purchased it from, or if they can't or won't remove the lock, then it's a brick. There is a very real chance that it's stolen.

  • I have an icon in the upper right hand corner, its a lock with a circle around it.  What is this?  How do I get rid of it?

    I have an icon in the upper right hand corner, its a lock with a circle around it.  What is this?  How do I get rid of it?

    maryfromgrand falls-windsor wrote:
    I have an icon in the upper right hand corner, its a lock with a circle around it.  What is this?  How do I get rid of it?
    It's the screen rotation lock symbol.
    When your screen is locked, photos won't rotate when you turn you iPhone sideways (or visa versa)
    It's for better viewing or a wider picture view.
    You can change it with the same icon in the slider menu from the bottom of your screen (upper right side).
    It toggles on or off.  

  • URL problems with SQL Server Reporting Services 2012 with wildcard SSL certificate

    Hi,
    I have single server, domain member, with SQL Server 2012 SP1 Reporting Services.
    I am trying to get work with url: https://reports.mydomain.com
    I have valid wildcard certificate (*.mydomain.com) implemented and configured URLs in Configuration Manager.
    https://reports.mydomain.com/ReportServer - works fine
    https://reports.3pro.hr/Reports/ - I got error:
    The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
    In rsreportserver.config I have:
    <Add Key="SecureConnectionLevel" Value="2"/>
    When looking my ReportServerService_date.log file I have something like:
    configmanager!DefaultDomain!3f4c!03/10/2013-20:24:34:: i INFO: Using report server internal url https://localhost:443/ReportServer.
    configmanager!DefaultDomain!3f4c!03/10/2013-20:24:34:: i INFO: Using report server external url https://serverhostname:443/ReportServer.
    configmanager!DefaultDomain!3f4c!03/10/2013-20:24:34:: i INFO: Using url root https://reports.mydomain.com/ReportServer.
    configmanager!DefaultDomain!3f4c!03/10/2013-20:24:34:: i INFO: Using report server internal url https://localhost:443/ReportServer.
    configmanager!DefaultDomain!3f4c!03/10/2013-20:24:34:: i INFO: Using report server external url https://serverhostname:443/ReportServer.
    configmanager!DefaultDomain!3f4c!03/10/2013-20:24:34:: i INFO: Using url root https://reports.mydomain.com/ReportServer.
    Also, error shown in log file:
    appdomainmanager!ReportManager_0-2!4c50!03/10/2013-20:24:53:: e ERROR: Remote certificate error RemoteCertificateNameMismatch encountered for url https://localhost/ReportServer/ReportService2010.asmx.
    ui!ReportManager_0-2!4c50!03/10/2013-20:24:54:: e ERROR: System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. ---> System.Security.Authentication.AuthenticationException:
    The remote certificate is invalid according to the validation procedure.
    Btw, is there a way to delete/disable access using https://localhost and/or servername (not FQDN) since SSL will not work in this way for me, and I want access only by full url - https://reports.mydomain.com , not localhost ..
    -- Hrvoje Kusulja

    I spent one of my 4 free support incidents with Microsoft (part of MSDN subscription) this year to get this investigated.  The tech support person helped me through several issues but had to leave to attend some training, and I got past the last hurdle
    before she called me back.  Here are the steps that resolved this issue for me.  I know for sure that step 5 was necessary.  Step 1 may not apply to you, and steps 2-4 may or may not have been necessary (they didn't immediately fix the issue,
    but I didn't roll them back either so they may have been necessary.)
    Step 1:
    Ensure you are editing the correct rsreportserver.config file.  I had been making changes to a file that was installed in C:\Program Files\Common Files\microsoft shared\Web Server Extensions\14\WebServices\Reporting, but that was a rsreportserver.config
    file for some sharepoint integration that I'm not using.  The correct path on my system was E:\MSRS11.MSSQLSERVER\Reporting Services\ReportServer\rsreportserver.config, but yours may vary. If you can't figure it out, look in the registry under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft
    SQL Server\MSRS11.MSSQLSERVER\Setup in the key named SQLPath, and then go to the ReportServer subdirectory of that path.
    Step 2: 
    In rsreportserver.config, ensure that SecureConnectionLevel is set to the value 3.  Was set to 0 in my configuration.  Corrected line in your rsreportserver.confiog file should look like:
    <Add Key="SecureConnectionLevel" Value="3"/>
    Step 3:
    In rsreportserver.config, add the correct value to the <URLRoot> element (which already exists in the file.)  In my configuration, this value was blank.  The value should be the fully qualified path to your report server, with a hostname that
    is valid for your certificate.  For example, if my cert matches *.mydomain.local:
    <UrlRoot>
    https://myserver.mydomain.local/ReportServer
    </UrlRoot>
    Step 4:
    Ensure that your certificate exists in Trusted Root Certification Authorities in certmgr for the local machine.  I had the certificate installed as a Personal certificate for the local machine, which I still think was correct (the certificate wasn't actually
    the problem and worked correctly for Report Server, and the failure was caused by SSRS incorrectly making a https request to a localhost URL), but she had me remove the certificate from Personal and add it to Trusted Root Certificate Authorities.  That
    broke things and the cert was no longer listed as a cert I could bind to, so we then copied it so it existed in both Personal and Trusted Root Certificate Authorities.  This is how I left it, not sure if that was necessary.
    Step 5:
    This was the fix that finally got things to work. In rsreportserver.config, add the same value to the <ReportServerUrl> element (which also already exists in the file) that you added in step 3.  In my configuration, this value was also blank.
    The corrected value should be the same as in step 3, for example:
    <ReportServerUrl>
    https://myserver.mydomain.local/ReportServer
    </ReportServerUrl>
    Then restart your report server (stop & then start in Report Server Configuration Manager), and the problem should go away.  At least it did for me.
    Good luck!

  • Implementing OOP inheritance in T-SQL (not an O/R question)

    Is it possible to cleanly obtain the inheritance benefit of object-oriented programming in T-SQL? 
    This is not about O/R mapping, which has been discussed to death all over the web, but rather specifically about implementing a form of inheritance in T-SQL.
    Here’s why I would ask such an insane question: 
    I maintain a large body of existing T-SQL that implements logic that has to be tightly tied to the database. 
    It’s not heavily declarative (i.e., does not rely heavily on large monolithic SQL statements and set manipulations), because the operations that have to be carried out are by their nature sequential. 
    (And imperative code can be tested in bite-size pieces, whereas huge, tight, brittle declarative SQL is difficult to maintain.) 
    And I can’t rewrite it.
    I’m now faced with the prospect of implementing new functionality, which will have the effect of introducing slight variations across the current
    functionality.  An obvious way to implement this would be with tests and branches in every place where the functionality has to vary. 
    This would spread the new functionality across the existing code in a rather unstructured way, making maintenance difficult. 
    At the other extreme, I could clone the entire codebase, and make the alterations in the cloned code for the new functionality. 
    At run-time, you would call into the correct code.  This would cause incredible code bloat and the attendant maintenance headaches.
    Inheritance and virtual functions would solve this nicely: the common code would be placed in one class, and the parts that vary in two
    other separate classes.  Alas, T-SQL does not implement inheritance.
    There is a third way: 
    implement virtual functions by hand in T-SQL.  At virtual function call sites, you would simply employ a lookup to determine the correct virtual function, and then call it dynamically.
     This could be easily expanded to handle a third set of logic and so on. 
    It would only require modifying the entire codebase once, to insert the virtual function call points. 
    The vtable of virtual functions could be stored as a table in SQL Server. 
    But this sounds like an awful thing to do to future maintainers.
    Has anyone else faced this situation, and how did you address it?  Does anyone know of any other approach that would mimic inheritance
    in T-SQL and/or avoid the uglinesses of the above?  Thanks.

    There is a third way: 
    implement virtual functions by hand in T-SQL.  At virtual function call sites, you would simply employ a lookup to determine the correct virtual function, and then call it dynamically.
    That can be done with
    dynamic SQL.
    However, there is always the ever-present performance requirement with database queries. So a fancy implementation can quickly collapse to plain in-line code stored procedure with performance benefits.
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Design & Programming
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • ADF BC Primary key generation with SQL Server DB

    Hi,
    I am using ADF 11.1.1.6 to develop a small application that will do some very basic CRUD operations on a SQL Server DB.
    I read through http://www.oracle.com/technetwork/developer-tools/jdev/multidatabaseapp-085183.html before I'm starting to implement the Entity objects.
    This document describes a way to do primary key generation using a table created in the DB and instructs to create an application connection to the Database :
    +2. Create a Connection to the Table+
    In your application, create a database connection named ROWIDAM_DB that points to the database containing your S_ROW_ID table. Alternatively, edit your BC project's properties and add the following Java option to the project's run configuration:
    -Djbo.rowid_am_conn_name= appconnection
    where appconnection is the name of a database connection that points to the S_ROW_ID table.
    My question is how do we do this when we mve to a production environment ?
    Also I'll be interested to hear if anyone has any pointers for developing ADF apps with SQL Server. (gotchas, performance pitfalls etc. )
    -Jeevan
    Upadte : This is SQL Server 2005
    Edited by: Jeevan Joseph on May 2, 2012 9:04 AM

    my apologies to everyone ... This should have been very simple. I just need to provide the config in my AM configuration(bc4j.xml)
    jbo.rowid_am_conn_name* should be set to the connection name you create. For production deployments, theres a similar
    jbo.rowid_am_datasource_name* that should work just fine (though I havent tried if it has any hiccups).
    I'd like to point out one thing though, for whoever might stumble upon this thread and find it useful later on...
    After I did the steps above, everything seemed to work when I tested the app from the AM tester. But when I built a UI for it in ADF Faces, I started getting an exception on Create/CreateInsert :
    java.lang.ClassCastException: com.microsoft.sqlserver.jdbc.SQLServerConnection cannot be cast to oracle.jdbc.OracleConnection
         at oracle.jbo.server.OracleSQLBuilderImpl.setSessionTimeZone(OracleSQLBuilderImpl.java:5533)
         at oracle.jbo.server.DBTransactionImpl.refreshConnectionMetadata(DBTransactionImpl.java:5311)
         at oracle.jbo.server.DBTransactionImpl.initTransaction(DBTransactionImpl.java:1194)
         at oracle.jbo.server.DBTransactionImpl.initTxn(DBTransactionImpl.java:6826)
         at oracle.jbo.server.DBTransactionImpl2.connect(DBTransactionImpl2.java:136)
         at oracle.jbo.common.ampool.DefaultConnectionStrategy.connect(DefaultConnectionStrategy.java:213)The trouble is that the ADF Faces adf-config.xml overrides the AM configuration. Oracle is the default, and it overrides the SQL flavor I set when initializing the Model project.
    This was not mentioned in the original document probably because ADF faces was out of scope for that document.
    I also found this thread extremely useful, and its what reminded me of the ADF Faces AM config overrides : Re: Locking mode 'optupdate' with SQL92
    Cheers !
    Jeevan

  • Urgent: Optimisic Locking with ChangedFieldsLockingPolicy

    Hi,
    I'm trying to implement optimistic locking with Toplink's ChangedFieldsLockingPolicy.
    If I create two UnitOfWorks, register the same object with each UOW and try to update the same field and commit, first UOW.commit() is successful and second UOW.commit() throws OptLockingExcpetion, which is perfect.
    This is kind of hardcoding. Here UOW is overlapping. But in real world, we have only one UOW at any given point of time for a transaction for one user. So I'm not sure whether we can achieve this result thru the application.
    But I want to get the exception in the following way:
    1. I'm opening 2 client sessions(2 browsers) and reading the same record on two browsers(say record A).
    Lets say I'm updating a field called NAME with initial value "name1".
    2. I updated the record(say record B) on client session1(client session 2 i.e. browser 2 still shows the old record, record A).
    SQL that I see in the log:
    UPDATE XYZ SET NAME = 'name2' WHERE ((ID = 13.0) AND (NAME = 'name1'))
    3. Now on client session 2 (browser2), when I try to update the record, I should get OptimisticLockingException because browser2 doesn't have the latest data(name2) and is trying to update the stale data(name1 which is not in the database).
    I'm not getting any exception because I think when I update the record in client session 1, it automatically refreshes the toplink's cache and when I try to update the stale data from browser2, it reads the latest object from cache and updating it. But I'm not sure this is what restricting me from implementing Locking.
    Here the SQL I see from Toplink's log is:
    UPDATE XYZ SET NAME = 'name3' WHERE ((ID = 13.0) AND (NAME = 'name2'))
    But I expect to see :
    UPDATE XYZ SET NAME = 'name3' WHERE ((ID = 13.0) AND (NAME = 'name1')) , which may probably cause OptLockingException.
    Any help is greatly appreciated. Please let me know if you need any additional information.
    Thank you..

    Optimistic locks happen when transactions overlap.
    IF you don't actually begin the unit of work in the second browser until the work from the first brower is committed, then apparently there is no overlap.
    One option is to begin the unit of work when you display the data in the browser, but of course you probably don't want to have long lived uow's hanging around...
    All I can suggest is that you keep a handle to the object you're displaying in the browser and compare it to the object from the second unit of work, to see if it had changed, before making the changes.
    - Don

  • Frequenet dead locks in SQL Server 2008 R2 SP2

    Hi,
    We are experiencing frequent dead locks in our application. We are using MSSQL Server 2008 R2 SP2 version. When our application is configured for 5-6 app servers, this issue is occurring frequently.
    But, when the same application is used with the MSSQL Server 2008 R2 or SQL Server 2012, we don't see the dead lock issue. From the error lock and sql trace, the error message is thrown for the database table JobLock. We have a stored procedure to insert/update
    for the above table when the job moves from one service to other. The same procedure works fine when used with the 2008 R2 and SQL Server 2012 Version.
    Is the above issue related to the hotfix from the below url?
    http://support.microsoft.com/kb/2703275
    Following error message is seen frequently in the log file.
    INFO : 03/24/2014 10:26:30:290 PM: [00007900:00005932] [Xerox.ISP.Workflow.ManagedActivity.PersistInTransaction] System.Data.SqlClient.SqlException (0x80131904): Transaction (Process ID 62) was deadlocked on lock resources with another process and has been
    chosen as the deadlock victim. Rerun the transaction.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
       at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
       at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
       at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
       at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
       at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.Practices.EnterpriseLibrary.Data.Database.DoExecuteNonQuery(DbCommand command)
       at Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteNonQuery(DbCommand command, DbTransaction transaction)
       at Xerox.ISP.DataAccess.Data.Utility.ExecuteNonQuery(TransactionManager transactionManager, DbCommand dbCommand)
       at Xerox.ISP.DataAccess.Data.SqlClient.SqlActivityProviderBase.ActivityReady(TransactionManager transactionManager, Int32 start, Int32 pageLength, Nullable`1 ActivityID, Nullable`1 JobId, String ContentUrl, Nullable`1 PrevWorkStep, Nullable`1
    CurrentWorkStep, String Principal, Nullable`1 Status, Nullable`1 ServerID, String HostName, Nullable`1 LockUserID, Nullable`1& ErrorCode, Byte[]& Activity_TS)
       at Xerox.ISP.DataAccess.Domain.ActivityBase.ActivityReady(Nullable`1 ActivityID, Nullable`1 JobId, String ContentUrl, Nullable`1 PrevWorkStep, Nullable`1 CurrentWorkStep, String Principal, Nullable`1 Status, Nullable`1 ServerID, String HostName,
    Nullable`1 LockUserID, Nullable`1& ErrorCode, Byte[]& Activity_TS, Int32 start, Int32 pageLength)
       at Xerox.ISP.DataAccess.Domain.ActivityBase.ActivityReady(Nullable`1 ActivityID, Nullable`1 JobId, String ContentUrl, Nullable`1 PrevWorkStep, Nullable`1 CurrentWorkStep, String Principal, Nullable`1 Status, Nullable`1 ServerID, String HostName,
    Nullable`1 LockUserID, Nullable`1& ErrorCode, Byte[]& Activity_TS)
       at Xerox.ISP.Workflow.ManagedActivity.<>c__DisplayClass2f.<ActivityReady>b__2d()
       at Xerox.ISP.Workflow.ManagedActivity.PersistInTransaction(Boolean createNew, PersistMethod persist)
    ClientConnectionId:9e44a64f-5014-4634-9cee-4581e1b9c299
    I look forward to the suggestions to get the issue resolved. Your input is much appreciated.
    Thanks,
    Keshava.

    If you are having deadlock trouble in your SQL Server instance, this recipe demonstrates how to make sure deadlocks are logged to the SQL ServerManagement Studio SQL log appropriately using
    the DBCC TRACEON, DBCC TRACEOFF, and DBCC TRACESTATUS commands. These functions enable, disable, and check the status of trace flags.
    To determine the cause of a deadlock, we need to know
    the resources involved and the types of locks acquired and requested. For this kind of information, SQL Server provides
    Trace Flag 1222 (this flag supersedes 1204, which was frequently used in earlier versions of SQL Server.)
    DBCCTRACEON(1222,
    -1);
    GO
    With this flag enabled, SQL Server will provide output in the form of a deadlock graph, showing the executing statements
    for each session, at the time of the deadlock; these are the statements that were blocked and so formed the conflict or cycle that led to the deadlock.
    Be aware that it is rarely possible to guarantee that deadlocks will never occur. Tuning for deadlocks
    primarily involves minimizing the likelihood of their occurrence. Most of the techniques for minimizing the occurrence of deadlocks are similar to the general techniques for minimizing blocking problems.

  • DeadLocks on Query Notifications with SQL Server 2008 SP3

    Hello,
    according to this article https://support.microsoft.com/kb/975090 the issue with deadlocks on query notifications should be fixed with SQL Server 2008 SP3 (10.0.5500.0). But we still get deadlocks in the following manner:
    <resource-list>
    <keylock hobtid="72057598393909248" dbid="5" objectname="MyDB.sys.query_notification_1411013420" indexname="cidx" id="lock1731c1f00" mode="RangeX-X" associatedObjectId="72057598393909248">
    <owner-list>
    <owner id="process573dc8" mode="RangeX-X"/>
    </owner-list>
    <waiter-list>
    <waiter id="process58ddc8" mode="RangeS-U" requestType="wait"/>
    </waiter-list>
    </keylock>
    <keylock hobtid="72057598372872192" dbid="5" objectname="MyDB.sys.query_notification_253437289" indexname="cidx" id="lock800c8780" mode="RangeS-U" associatedObjectId="72057598372872192">
    <owner-list>
    <owner id="process58ddc8" mode="RangeS-U"/>
    </owner-list>
    <waiter-list>
    <waiter id="process573dc8" mode="RangeS-U" requestType="wait"/>
    </waiter-list>
    </keylock>
    </resource-list>
    Is there any need to install another fix?
    Thanks in Advance!

    Hello,
    SQL Server 2008 SP4 and all cumulative updates of SP3 do not have fixes related to deadlocks.
    Maybe the following workarounds and solutions can help in your scenario.
    http://stackoverflow.com/questions/3707137/understanding-deadlocks-with-sql-server-query-notifications
    Deadlock Prevention. In case you need to lock multiple conversation groups in a transaction, you need to take the same order to lock the different conversation groups in all transactions, otherwise you will have a deadlock issues.
    Source:
    http://blogs.msdn.com/b/kangmo/archive/2008/12/17/a-brief-guide-on-sql-server-service-broker.aspx
    Try to may transactions more simple and shorter.
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

Maybe you are looking for

  • Unique problem regarding keyboard and beyond.

    so i have an interesting problem. some of the buttons on my keyboard have become unresponsive, volume controls, screen brightness, etc... when i press FN and use some of these keys they do make certain things pop up like the calculator and clock etc.

  • Download restrictions in Mountain Lion?

    Looks like ML has new security restrictions. I used to be able to download builds from a trusted site with no problems in OS X 10.6. With ML, I am now getting an error message 'Problem connecting to the server: URLs with the type "file:' are not supp

  • DIR attchment at the PO header level

    Hi Gurus, I know that we can attach a DIR to the line item of a PO. Is there any way to attach a DIR to the PO header. I know we can attach the documents ( not the DIR) directly to the PO header using the Service Object functionality. How about the D

  • Helping in long decode

    Hello world, i have a problem, i created a form and inside it in program unit i created code with decode, the probem i want to add more option inside decode for filtering but you know my decode very long and complex for example , sum(decode(classnum,

  • Text suggestions not showing up/disappearing

    I mainly use three languages (German, French, English) when typing messages in my Lumia 535. Where "text suggestions" show up in French and English all the time, in German, they do not show up/disappear after typing and sending two or three messages