<commit_before><?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
	xmlns:tx="http://www.springframework.org/schema/tx"
	xmlns:util="http://www.springframework.org/schema/util"
	xsi:schemaLocation="
       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
       http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
       http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
       http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd">

	<!-- Trun on Spring's auotproxy using AspectJ's @Aspect annotations. -->
	<aop:aspectj-autoproxy />

	<!-- This is serving as the JDBC connection pool -->
	<bean id="dataSourcePool" class="org.apache.commons.dbcp.BasicDataSource"
		destroy-method="close" depends-on="stackConfiguration">
		<property name="driverClassName" ref="stackConfiguration.repositoryDatabaseDriver" />
		<property name="url"
			ref="stackConfiguration.repositoryDatabaseConnectionUrl" />
		<property name="username"
			ref="stackConfiguration.repositoryDatabaseUsername" />
		<property name="password"
			ref="stackConfiguration.repositoryDatabasePassword" />
		<!-- The minimum number of connections in the pool at all times -->
		<property name="minIdle"
			ref="stackConfiguration.databaseConnectionPoolMinNumberConnections" />
		<!-- The maximum number of connections in the pool -->
		<property name="maxActive"
			ref="stackConfiguration.databaseConnectionPoolMaxNumberConnections" />
		<!-- This will test a connection to see if it is alive when a connection 
			is fetched from the pool -->
		<property name="testOnBorrow"
			ref="stackConfiguration.databaseConnectionPoolShouldValidate" />
		<!-- This is the SQL uses to test if a connection is alive -->
		<property name="validationQuery"
			ref="stackConfiguration.databaseConnectionPoolValidateSql" />
		<!-- Default all transaction to TRANSACTION_READ_COMMITTED -->
		<property name="defaultTransactionIsolation">
			<util:constant static-field="java.sql.Connection.TRANSACTION_READ_COMMITTED"/>
		</property>
	</bean>

	<!-- A profiler that logs performance data for all bean method calls. -->
	<bean id="poolLogger" class="org.sagebionetworks.repo.model.jdo.ConnectionPoolLogger" />

	<!-- The default behavior of Spring is to only roll-back on RuntimeExceptions 
		not Exceptions. In the past that is has caused us to commit on IOException 
		and InterruptedException See PLFM-2108. This advice 
		will ensure that we rollback for all exceptions -->
	<tx:advice id="defaultWriteTxRollbackAdvice" transaction-manager="txManager">
		<tx:attributes>
			<tx:method name="*" propagation="REQUIRED" rollback-for="Throwable" />
		</tx:attributes>
	</tx:advice>
	<tx:advice id="readCommittedWriteTxRollbackAdvice" transaction-manager="txManager">
		<tx:attributes>
			<tx:method name="*" propagation="REQUIRED" rollback-for="Throwable" isolation="READ_COMMITTED" />
		</tx:attributes>
	</tx:advice>
	<tx:advice id="requiresNewReadCommittedRollbackAdvice" transaction-manager="txManager">
		<tx:attributes>
			<tx:method name="*" propagation="REQUIRES_NEW" rollback-for="Throwable" isolation="READ_COMMITTED" />
		</tx:attributes>
	</tx:advice>	
	<tx:advice id="defaultNewWriteTxRollbackAdvice" transaction-manager="txManager">
		<tx:attributes>
			<tx:method name="*" propagation="REQUIRES_NEW" rollback-for="Throwable" />
		</tx:attributes>
	</tx:advice>
	<tx:advice id="defaultMandatoryWriteTxRollbackAdvice" transaction-manager="txManager">
		<tx:attributes>
			<tx:method name="*" propagation="MANDATORY" rollback-for="Throwable" />
		</tx:attributes>
	</tx:advice>

	<!-- These advisor will be applied to any method with the @WriteTransaction, @NewWriteTransaction and 
		@MandatoryWriteTransaction annotations. This allows us to change the default rollback exception types 
		for all of our transactional methods -->
	<aop:config>
		<aop:pointcut id="defaultWrites"
			expression="@annotation(org.sagebionetworks.repo.transactions.WriteTransaction)" />
		<aop:advisor pointcut-ref="defaultWrites" advice-ref="defaultWriteTxRollbackAdvice" />
	</aop:config>
	<aop:config>
		<aop:pointcut id="readCommittedWrites"
			expression="@annotation(org.sagebionetworks.repo.transactions.WriteTransactionReadCommitted)" />
		<aop:advisor pointcut-ref="readCommittedWrites" advice-ref="readCommittedWriteTxRollbackAdvice" />
	</aop:config>
	<aop:config>
		<aop:pointcut id="requiresNewReadCommitted"
			expression="@annotation(org.sagebionetworks.repo.transactions.RequiresNewReadCommitted)" />
		<aop:advisor pointcut-ref="requiresNewReadCommitted" advice-ref="requiresNewReadCommittedRollbackAdvice" />
	</aop:config>			<commit_msg>all transaction annotations explicitly set transaction isolation level<commit_after><?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
	xmlns:tx="http://www.springframework.org/schema/tx"
	xmlns:util="http://www.springframework.org/schema/util"
	xsi:schemaLocation="
       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
       http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
       http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
       http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd">

	<!-- Trun on Spring's auotproxy using AspectJ's @Aspect annotations. -->
	<aop:aspectj-autoproxy />

	<!-- This is serving as the JDBC connection pool -->
	<bean id="dataSourcePool" class="org.apache.commons.dbcp.BasicDataSource"
		destroy-method="close" depends-on="stackConfiguration">
		<property name="driverClassName" ref="stackConfiguration.repositoryDatabaseDriver" />
		<property name="url"
			ref="stackConfiguration.repositoryDatabaseConnectionUrl" />
		<property name="username"
			ref="stackConfiguration.repositoryDatabaseUsername" />
		<property name="password"
			ref="stackConfiguration.repositoryDatabasePassword" />
		<!-- The minimum number of connections in the pool at all times -->
		<property name="minIdle"
			ref="stackConfiguration.databaseConnectionPoolMinNumberConnections" />
		<!-- The maximum number of connections in the pool -->
		<property name="maxActive"
			ref="stackConfiguration.databaseConnectionPoolMaxNumberConnections" />
		<!-- This will test a connection to see if it is alive when a connection 
			is fetched from the pool -->
		<property name="testOnBorrow"
			ref="stackConfiguration.databaseConnectionPoolShouldValidate" />
		<!-- This is the SQL uses to test if a connection is alive -->
		<property name="validationQuery"
			ref="stackConfiguration.databaseConnectionPoolValidateSql" />
		<!-- Default all transaction to TRANSACTION_READ_COMMITTED -->
		<property name="defaultTransactionIsolation">
			<util:constant static-field="java.sql.Connection.TRANSACTION_READ_COMMITTED"/>
		</property>
	</bean>

	<!-- A profiler that logs performance data for all bean method calls. -->
	<bean id="poolLogger" class="org.sagebionetworks.repo.model.jdo.ConnectionPoolLogger" />

	<!-- The default behavior of Spring is to only roll-back on RuntimeExceptions 
		not Exceptions. In the past that is has caused us to commit on IOException 
		and InterruptedException See PLFM-2108. This advice 
		will ensure that we rollback for all exceptions -->
	<tx:advice id="defaultWriteTxRollbackAdvice" transaction-manager="txManager">
		<tx:attributes>
			<tx:method name="*" propagation="REQUIRED" rollback-for="Throwable" isolation="REPEATABLE_READ" />
		</tx:attributes>
	</tx:advice>
	<tx:advice id="readCommittedWriteTxRollbackAdvice" transaction-manager="txManager">
		<tx:attributes>
			<tx:method name="*" propagation="REQUIRED" rollback-for="Throwable" isolation="READ_COMMITTED" />
		</tx:attributes>
	</tx:advice>
	<tx:advice id="requiresNewReadCommittedRollbackAdvice" transaction-manager="txManager">
		<tx:attributes>
			<tx:method name="*" propagation="REQUIRES_NEW" rollback-for="Throwable" isolation="READ_COMMITTED" />
		</tx:attributes>
	</tx:advice>	
	<tx:advice id="defaultNewWriteTxRollbackAdvice" transaction-manager="txManager">
		<tx:attributes>
			<tx:method name="*" propagation="REQUIRES_NEW" rollback-for="Throwable" isolation="REPEATABLE_READ" />
		</tx:attributes>
	</tx:advice>
	<tx:advice id="defaultMandatoryWriteTxRollbackAdvice" transaction-manager="txManager">
		<tx:attributes>
			<tx:method name="*" propagation="MANDATORY" rollback-for="Throwable" isolation="REPEATABLE_READ" />
		</tx:attributes>
	</tx:advice>

	<!-- These advisor will be applied to any method with the @WriteTransaction, @NewWriteTransaction and 
		@MandatoryWriteTransaction annotations. This allows us to change the default rollback exception types 
		for all of our transactional methods -->
	<aop:config>
		<aop:pointcut id="defaultWrites"
			expression="@annotation(org.sagebionetworks.repo.transactions.WriteTransaction)" />
		<aop:advisor pointcut-ref="defaultWrites" advice-ref="defaultWriteTxRollbackAdvice" />
	</aop:config>
	<aop:config>
		<aop:pointcut id="readCommittedWrites"
			expression="@annotation(org.sagebionetworks.repo.transactions.WriteTransactionReadCommitted)" />
		<aop:advisor pointcut-ref="readCommittedWrites" advice-ref="readCommittedWriteTxRollbackAdvice" />
	</aop:config>
	<aop:config>
		<aop:pointcut id="requiresNewReadCommitted"
			expression="@annotation(org.sagebionetworks.repo.transactions.RequiresNewReadCommitted)" />
		<aop:advisor pointcut-ref="requiresNewReadCommitted" advice-ref="requiresNewReadCommittedRollbackAdvice" />
	</aop:config>			
{'fraction_non_alphanumeric': 0.13417419803356836, 'fraction_numerical': 0.003972589134968716, 'mean_word_length': 5.58600392413342, 'pattern_counts': {'":': 0, '<': 131, '<?xml version=': 2, '>': 131, 'https://': 0, 'lorem ipsum': 0, 'www.': 26, 'xml': 12}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1562507', 'n_tokens_mistral': 3234, 'n_tokens_neox': 3013, 'n_words': 580}