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 constraint

for 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

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -