title: Spring Transaction with Sybase
body: <p>I am using Spring in my Web Application , with the underlying database as Sybase.</p>
  
  <p>I have 3 complex stored procedures to be executed. 
  The procs , have <strong>create table</strong> and <strong>drop table</strong> commands to hold temporary result sets.</p>
  
  <p>The tables are created in the user db space , rather that in the tempdb space. Hence, I am faced with the need to ensure that the entire service operation from the service bean , that would have DAO objects calling the stored procs, to be serialized. Does simply making the service bean method a Spring Transaction, ensure a solution to potential concurrency related problems in my case? </p>
  
  <p>Another thing that I noticed is that, annotating my service method as @Transactional , made the sybase database throw an error : "Create table command cannot be executed within a transaction". Does this mean that Spring makes the entire database operation a transaction?
  I am really not clear about this , and any explanation would be welcome.
  Meaning if I have a stored proc named <strong>myproc</strong> . The sybase statement would be <strong>exec myproc</strong>. This,say, is executed by the DAOobject from the service method, annotated as @Transactional. Now does Spring make the database operation as "<strong>begin tran 
  exec myproc 
  end tran</strong>". My observation seems to suggest that. Please explain.</p>
  
  <p>And also explain, if just annotation of @Transactional , will solve my concurrency issues. I , actually don't want 2 instances of my stored proc to be running on the database , at a time.</p>