# Spring-Transaktionen (Spring Boot) > Transaktionsverwaltung mit @Transactional, propagation, isolation, rollback, PlatformTransactionManager - 30 Interview-Fragen - Senior - [Interview-Fragen: Spring Boot](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen.md) ## 1. Was ist die Hauptaufgabe der @Transactional-Annotation in Spring? **Antwort** @Transactional gibt an, dass eine Methode innerhalb eines transaktionalen Kontexts ausgeführt werden soll, und gewährleistet die Atomarität von Datenbankoperationen. Spring erstellt automatisch einen AOP-Proxy um die Klasse, um Beginn, Commit und Rollback von Transaktionen zu verwalten. Dieser deklarative Ansatz vereinfacht die Transaktionsverwaltung erheblich im Vergleich zur manuellen Programmierung mit TransactionTemplate oder PlatformTransactionManager. ## 2. Was ist der standardmäßige Propagation-Typ für @Transactional? **Antwort** Propagation.REQUIRED ist der standardmäßige Propagation-Typ. Mit dieser Strategie tritt Spring einer vorhandenen Transaktion bei, falls eine existiert, oder erstellt andernfalls eine neue. Dies ist das gängigste und intuitivste Verhalten für die meisten Anwendungsfälle und stellt sicher, dass für Datenbankoperationen immer eine Transaktion vorhanden ist. ## 3. Was passiert, wenn in einer @Transactional-Methode eine RuntimeException geworfen wird? **Antwort** Standardmäßig führt Spring automatisch ein Rollback der Transaktion durch, wenn eine RuntimeException (oder ein Error) geworfen wird. Dies stellt sicher, dass Datenbankänderungen bei unerwarteten Fehlern rückgängig gemacht werden. Checked Exceptions hingegen (die von Exception, aber nicht von RuntimeException erben) lösen standardmäßig kein Rollback aus, sofern sie nicht explizit mit rollbackFor angegeben werden. ## 27 weitere Fragen verfügbar - Wo kann die @Transactional-Annotation angewendet werden? - Welches Verhalten verfolgt Propagation.REQUIRES_NEW? Kostenlos registrieren: https://sharpskill.dev/de/login ## Weitere Spring Boot-Interviewthemen - [Spring Core - IoC & DI](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/spring-core-ioc-di.md): 22 Fragen, Junior - [Spring Boot Auto-Configuration](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/spring-boot-auto-configuration.md): 20 Fragen, Junior - [Spring Boot Starters](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/spring-boot-starters.md): 18 Fragen, Junior - [Application Properties & YAML](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/application-properties-yml.md): 16 Fragen, Junior - [Logging mit SLF4J und Logback](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/logging.md): 20 Fragen, Junior - [Spring Boot DevTools](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/spring-boot-devtools.md): 15 Fragen, Junior - [Spring MVC Basics](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/spring-mvc-basics.md): 20 Fragen, Mid-Level - [Spring REST Controllers](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/spring-rest-controllers.md): 20 Fragen, Mid-Level - [Request & Response Handling](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/request-response-handling.md): 20 Fragen, Mid-Level - [Ausnahmebehandlung](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/exception-handling.md): 25 Fragen, Mid-Level - [Bean Validation](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/bean-validation.md): 25 Fragen, Mid-Level - [Spring Data JPA Grundlagen](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/spring-data-jpa-basics.md): 25 Fragen, Mid-Level - [JPA-Entitäten und Beziehungen](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/jpa-entities-relationships.md): 30 Fragen, Mid-Level - [JPA-Abfragen](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/jpa-queries.md): 30 Fragen, Mid-Level - [Spring Data Repositories](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/spring-data-repositories.md): 25 Fragen, Mid-Level - [Spring Security Grundlagen](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/spring-security-basics.md): 25 Fragen, Mid-Level - [Spring Boot Actuator](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/spring-boot-actuator.md): 20 Fragen, Mid-Level - [Unit-Tests mit JUnit & Mockito](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/testing-junit-mockito.md): 30 Fragen, Mid-Level - [Spring Boot Testing](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/spring-boot-testing.md): 30 Fragen, Mid-Level - [Profiles und Environment](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/profiles-environment.md): 20 Fragen, Mid-Level - [RestTemplate und WebClient](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/resttemplate-webclient.md): 24 Fragen, Mid-Level - [Async & Scheduling](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/async-scheduling.md): 25 Fragen, Mid-Level - [Caching mit Spring](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/caching.md): 25 Fragen, Mid-Level - [Spring WebFlux (Reactive)](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/spring-webflux.md): 25 Fragen, Mid-Level - [Erweiterte Authentifizierung und Autorisierung](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/authentication-authorization.md): 30 Fragen, Senior - [JWT & Stateless-Sicherheit](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/jwt-stateless-security.md): 20 Fragen, Senior - [OAuth2 & Authorization Server](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/oauth2-authorization-server.md): 20 Fragen, Senior - [Spring Boot und Docker](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/spring-boot-docker.md): 19 Fragen, Senior - [Microservices mit Spring](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/microservices-basics.md): 25 Fragen, Senior - [Spring Cloud Config](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/spring-cloud-config.md): 19 Fragen, Senior - [Performance-Optimierung](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/performance-optimization.md): 30 Fragen, Senior - [GraalVM Native Images](https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/graalvm-native-images.md): 20 Fragen, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/de/technologies/spring-boot/interviewfragen/transactions