• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

View of SQL Server getting locked in JDBC

 
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all,

I am using a JSP/JDBC which is having a select statement. The query refers to a VIEW created based on a join between 2 tables.
The JSP page displays the records which are fetched as a result of the query executed on the VIEW.

Problem faced :

The VIEW gets locked and the JSP page doesnt display any records.

Only when I release the lock on the view, I am able to see only a fraction of the records which are queried by the same VIEW.

BTW, There are no inserts or any other operations perfomed on these 2 tables from any other client/JSP pages.

Any idea what is going wrong.

Rgds,

Seetesh
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How did you determine that the problem was a deadlock by the way? In normal operation SQL Server will use shared locks for views, and shared locks cannot cause deadlock problems with each other - shared locks can co-exist quite happily for the same row, page or table (hence the name "shared"). Such a lock should only cause a problem if some other process needs to update something which currently has a shared lock against it. It should also be released fairly quickly unless your transaction isolation level is set to SERIALIZABLE or REPEATABLE READ or you've used a HOLDLOCK locking hint.
 
What do you have in that there bucket? It wouldn't be a tiny ad by any chance ...
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic