Skip to content

Thread safety and state

DuyHai DOAN edited this page Aug 7, 2013 · 8 revisions

By design, the Achilles' EntityManager is stateless. It only contains references to meta data and pre-built DAOs/prepared statements. For common operations (persist, merge, remove...) it delegates the job to underlying implementation classes.

Thus the EntityManager is thread-safe and can be injected as a singleton in any of your DAO/Services.

Example:

	...
	@Inject
	private CQLEntityManager em;
	...
	...

Home

Clone this wiki locally