unit testing - How to force an exception in JPA when executing a joinTransaction() or commit()? -
unit testing - How to force an exception in JPA when executing a joinTransaction() or commit()? -
for testing database related code using jpa using in-memory database such hsqldb:
how can forcefulness exception raised when executing entitymanager.jointransaction()
or entitymanager.gettransaction().commit()
?
i'd forcefulness exception without altering tables database (ex. deleting table test perform persist()
).
some ways,
shutdown database violate foreign key or unique constraintfor jointransaction() i'm not sure much, joins jta transaction. throw error if not in jta transaction, or potentially in transaction, or resource_local.
unit-testing exception java-ee jpa
Comments
Post a Comment