Note that there are some explanatory texts on larger screens.

plurals
  1. POSpring transaction not committing
    primarykey
    data
    text
    <p>I'm having a strange problem with my transactions not committing in spring. After profiling the database it looks like spring is committing the transaction before it starts?</p> <p>Here is what I am seeing the the profiler..</p> <pre><code>SQL:BatchStarting select 1 SQL:BatchCompleted select 1 SQL:BatchStarting IF @@TRANCOUNT &gt; 0 COMMIT TRAN SQL:BatchCompleted IF @@TRANCOUNT &gt; 0 COMMIT TRAN RPC:Completed exec vbosv_DLLVersion_Update 77,N'15',NULL,N'12.2.2.1',N'12.2.3.4' </code></pre> <p>The transaction is not committed in this case but if i run a piece of code after this that calls the database again it will commit the previous transaction. I think that it is committing then because it starts with <code>IF @@TRANCOUNT &gt; 0 COMMIT TRAN</code>.</p> <p>I used declarative transaction management and here are some of my configs</p> <pre><code>&lt;!-- Transactional Advice --&gt; &lt;tx:advice id="txAdvice" transaction-manager="txManager"&gt; &lt;tx:attributes&gt; &lt;tx:method name="process*" rollback-for="Throwable"/&gt; &lt;tx:method name="write*" rollback-for="Throwable"/&gt; &lt;tx:method name="upload*" rollback-for="Throwable"/&gt; &lt;tx:method name="store*" rollback-for="Throwable"/&gt; &lt;/tx:attributes&gt; &lt;/tx:advice&gt; &lt;aop:config&gt; &lt;aop:pointcut id="dataServicesOperation" expression="execution(* com.enterprise.dataservices.DataServicesImpl.*(..))"/&gt; &lt;aop:advisor advice-ref="txAdvice" pointcut-ref="dataServicesOperation"/&gt; &lt;/aop:config&gt; </code></pre> <p>I'm a spring newbie and sort of lost on whats happening here. Thanks ahead for and help!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload