Skip to content

Commit

Permalink
Change Database transaction example from NEVER to NOT_SUPPORTED (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Nov 25, 2024
1 parent 2198bc3 commit 1c24904
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions docs/modules/ROOT/pages/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ Caused by: java.sql.SQLException: Enlisted connection used without active transa
----


IMPORTANT: In your service you must use `@Transactional(Transactional.TxType.NEVER)` above the method that is filling your report.
IMPORTANT: In your service you must use `@Transactional(Transactional.TxType.NOT_SUPPORTED)` above the method that is filling your report.
[source,java]
----
@Inject
DataSource datasource;
@Transactional(Transactional.TxType.NEVER)
@Transactional(Transactional.TxType.NOT_SUPPORTED)
public byte[] text() throws JRException, SQLException {
JasperPrint jasperPrint = null;
try (final Connection connection = datasource.getConnection()) {
Expand Down Expand Up @@ -112,4 +112,4 @@ CAUTION: Make sure `.dockerignore` does not exclude `.so` files!
[[extension-configuration-reference]]
== Extension Configuration Reference

include::includes/quarkus-jasperreports.adoc[leveloffset=+1, opts=optional]
include::includes/quarkus-jasperreports.adoc[leveloffset=+1, opts=optional]
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import net.sf.jasperreports.pdf.JRPdfExporter;

@ApplicationScoped
@Transactional(Transactional.TxType.NEVER)
@Transactional(Transactional.TxType.NOT_SUPPORTED)
public class DatabaseReportService extends AbstractJasperResource {

@Inject
Expand Down Expand Up @@ -68,4 +68,4 @@ private JasperPrint fill(final String reportName) throws JRException, SQLExcepti
}
}

}
}

0 comments on commit 1c24904

Please sign in to comment.