Git Product home page Git Product logo

jopa-spring-transaction's People

Contributors

dependabot[bot] avatar ledsoft avatar the-alchemist avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

jopa-spring-transaction's Issues

Implement getResultStream in queries

Current implementation of query wrappers use the default getResultStream method implementation from Query interface, which invokes getResultList. It would be better if they implemented it and invoked getResultStream of the delegate query instance.

Note that EntityManager needs to be closed when stream processing is finished.

Transactions not working when DAOs are structured in a class hierarchy

The setup contains an inheritance hierarchy on DAO objects described below. It ends up with an exception during deployment "Bean named 'datasetSourceDao' is expected to be of type 'cz.cvut.kbss.datasetdashboard.dao.DatasetSourceDao' but was actually of type 'com.sun.proxy.$Proxy38'.

When I flatten all DAOs into a single DAO, the transactions work.

I have a REST controller that autowires a service that autowires an instance of DatasetSourceDao. This DAO inherits from a base DAO (GenericDao being a generic DAO interface)
public abstract class BaseDao implements GenericDao {
@Autowired private EntityManager em;
...
@transactional("txManager")
public T find(URI uri) {
return em.find(type, uri);
}
...
}

and an inherited DAO

@repository
public class DatasetSourceDao extends BaseDao<dataset_source> {
@Autowired private EntityManager em;
public DatasetSourceDao() { super(dataset_source.class); }

@Transactional("txManager")
public void anotherMethod() {

...
}
...
}

Read-only transactions

Support for read-only transactions should be added, so that retrieve methods can be transactional instead of running outside of transaction and closing entity manager after each operation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.