Showing posts with label second. Show all posts
Showing posts with label second. Show all posts

Thursday, March 22, 2012

Deadlock problem

Hello,
We have more deadlock after we insert a second database in our server of
database. The allocating of memory is dynamic. One DB was for the
production and the other for testing.
The two DB are sollicitated at each minute. How sql server manage is
memory? Can we give a priority of allocation of memory for the DB of
production. Do you think that the deadlock, occured because we insert this
second database? Each database make 6 GIGs. We have 1 GIG of memory.
We're gonna try to remove the second database for see if it's the problem.
Thank for your help
DanHi Dany.
Deadlocks & memory allocation are not directly related issues. Deadlocks
occur because of locking conflicts within the database - eg multiple
connections trying to update each other's rows at the same time..
Memory conflicts can occur between multiple instances of sql server on the
same computer, but a single instance of sql server manages memory allocation
between individual databases seemlessly.
Regards,
Greg Linwood
SQL Server MVP
"Dany Marois" <dany.marois@.videotron.ca> wrote in message
news:OrTYzoO6DHA.2568@.TK2MSFTNGP10.phx.gbl...
quote:

> Hello,
> We have more deadlock after we insert a second database in our server of
> database. The allocating of memory is dynamic. One DB was for the
> production and the other for testing.
> The two DB are sollicitated at each minute. How sql server manage is
> memory? Can we give a priority of allocation of memory for the DB of
> production. Do you think that the deadlock, occured because we insert this
> second database? Each database make 6 GIGs. We have 1 GIG of memory.
> We're gonna try to remove the second database for see if it's the problem.
> Thank for your help
> Dan
>

Deadlock problem

Hello,
We have more deadlock after we insert a second database in our server of
database. The allocating of memory is dynamic. One DB was for the
production and the other for testing.
The two DB are sollicitated at each minute. How sql server manage is
memory? Can we give a priority of allocation of memory for the DB of
production. Do you think that the deadlock, occured because we insert this
second database? Each database make 6 GIGs. We have 1 GIG of memory.
We're gonna try to remove the second database for see if it's the problem.
Thank for your help
DanHi Dany.
Deadlocks & memory allocation are not directly related issues. Deadlocks
occur because of locking conflicts within the database - eg multiple
connections trying to update each other's rows at the same time..
Memory conflicts can occur between multiple instances of sql server on the
same computer, but a single instance of sql server manages memory allocation
between individual databases seemlessly.
Regards,
Greg Linwood
SQL Server MVP
"Dany Marois" <dany.marois@.videotron.ca> wrote in message
news:OrTYzoO6DHA.2568@.TK2MSFTNGP10.phx.gbl...
> Hello,
> We have more deadlock after we insert a second database in our server of
> database. The allocating of memory is dynamic. One DB was for the
> production and the other for testing.
> The two DB are sollicitated at each minute. How sql server manage is
> memory? Can we give a priority of allocation of memory for the DB of
> production. Do you think that the deadlock, occured because we insert this
> second database? Each database make 6 GIGs. We have 1 GIG of memory.
> We're gonna try to remove the second database for see if it's the problem.
> Thank for your help
> Dan
>

Thursday, March 8, 2012

Dead Lock

Hello !!!

I have 2 transactions, the first one has MANY updates to the table A and it finishes with a commit or rollback (ONLY AT THE END), the second one has only one insert into the table A that finishes with a commit or rollback, the problem is that the update process takes a long time to finish, and the insert process could be thrown during the first process, there's where I get everything locked cause the table A is locked and my java aplication gets stuck.

Note: When I execute each transaction independient I have no problems.

Is there any possibility to lock table A completly for the first transaction and release It for second one ??

Could you give me any suggestion of what to do step by step ?

Thanks !!!Are you running these processes by submitting SQL commands from your Java App, or are you just executing existing Stored Procedures?|||begin tran
select 1 from tableA (tablock) where 1=2
update...
if @.@.error != 0 begin
...
rollback tran
return (1)
end
...
commit tran