Examples of Transactional


Examples of org.jboss.arquillian.transaction.api.annotation.Transactional

     * @return the transaction mode
     */
    private TransactionMode getTransactionMode(TestEvent testEvent) {

        // retrieves the transaction annotation
        Transactional transactional = getTransactionalAnnotation(testEvent);

        // returns the transaction mode
        return transactional.value();
    }
View Full Code Here

Examples of org.jrest4guice.transaction.annotations.Transactional

  public Object invoke(MethodInvocation methodInvocation) throws Throwable {
    log.debug("[IbatisLocalTransactionInterceptor]进入=》"+methodInvocation.getMethod().getName());
    SqlMapClientHolder sqlMapClientHolder = GuiceContext.getInstance().getBean(SqlMapClientHolder.class);
   
    Method method = methodInvocation.getMethod();
    Transactional transactional = method.getAnnotation(Transactional.class);
    if(transactional == null){
      transactional = method.getDeclaringClass().getAnnotation(Transactional.class);
    }
   
    TransactionalType type = transactional.type();
   
    IbatisTransaction transaction = sqlMapClientHolder.getIbatisTransaction();
   
    if(transaction.isActive()){
      return methodInvocation.proceed();
View Full Code Here

Examples of org.jrest4guice.transaction.annotations.Transactional

    SessionFactoryHolder sessionFH = GuiceContext.getInstance().getBean(SessionFactoryHolder.class);
    SessionInfo session = sessionFH.getSessionInfo();
   
    Method method = methodInvocation.getMethod();
    Transactional transactional = method.getAnnotation(Transactional.class);
    if(transactional == null){
      transactional = method.getDeclaringClass().getAnnotation(Transactional.class);
    }

    TransactionalType type = transactional.type();
   
    final Transaction transaction = session.getSession().getTransaction();

    if(type != TransactionalType.READOLNY){
      session.setNeed2ProcessTransaction(true);
View Full Code Here

Examples of org.jrest4guice.transaction.annotations.Transactional

    EntityManagerFactoryHolder emfH = GuiceContext.getInstance().getBean(EntityManagerFactoryHolder.class);
    EntityManagerInfo entityManager = emfH.getEntityManagerInfo();
   
    Method method = methodInvocation.getMethod();
    Transactional transactional = method.getAnnotation(Transactional.class);
    if(transactional == null){
      transactional = method.getDeclaringClass().getAnnotation(Transactional.class);
    }
   
    TransactionalType type = transactional.type();
    if(type != TransactionalType.READOLNY){
      entityManager.setNeed2ProcessTransaction(true);
    }
   
    final EntityTransaction transaction = entityManager.getEntityManager().getTransaction();
View Full Code Here

Examples of org.springframework.test.transaction.Transactional

  private JdbcInviteRepository inviteRepository;
 
  public JdbcInviteRepositoryTest() {
    EmbeddedDatabase db = new GreenhouseTestDatabaseBuilder().member().activity().invite().testData(getClass()).getDatabase();
    transactional = new Transactional(db);
    jdbcTemplate = new JdbcTemplate(db);
    JdbcActionRepository actionRepository = new JdbcActionRepository(jdbcTemplate, new ActionGateway() {
      public void actionPerformed(Action action) {
      }
    });
View Full Code Here

Examples of org.springframework.transaction.annotation.Transactional

     * @param args method arguments.
     * @return referred stored bean.
     * @throws UnresolvedReferenceException in case of failures, read-only methods and unresolved bean.
     */
    public T resolveBeanReference(final Method method, final Object... args) throws UnresolvedReferenceException {
        final Transactional transactional = method.getAnnotation(Transactional.class);
        if (transactional != null && transactional.readOnly()) {
            throw new UnresolvedReferenceException();
        }
        return resolveReference(method, args);
    }
View Full Code Here

Examples of org.springframework.transaction.annotation.Transactional

    @Produce(uri = "mock:book")
    ProducerTemplate producer;

    @Consume(uri = "seda:book")
    public void handleTitle(String title) {
        Transactional tx = this.getClass().getAnnotation(Transactional.class);
        if (tx == null) {
            throw new IllegalStateException("Spring annotation-driven should have instrumented this class as @Transactional");
        }
        if (!"NEVER".equals(tx.propagation().name())) {
            throw new IllegalStateException("Should be NEVER propagation");
        }
        if (!tx.readOnly()) {
            throw new IllegalStateException("Should be read only");
        }

        if (!title.contains("in Action")) {
            throw new IllegalArgumentException("Not a book title we like");
View Full Code Here

Examples of org.springframework.transaction.annotation.Transactional

    @EndpointInject(uri = "seda:book")
    private ProducerTemplate template;

    public void orderBook(String title) throws Exception {
        Transactional tx = this.getClass().getAnnotation(Transactional.class);
        if (tx == null) {
            throw new IllegalStateException("Spring annotation-driven should have instrumented this class as @Transactional");
        }
        if (!"REQUIRED".equals(tx.propagation().name())) {
            throw new IllegalStateException("Should be REQUIRED propagation");
        }

        if (title.startsWith("Donkey")) {
            throw new IllegalArgumentException("We don't have Donkeys, only Camels");
View Full Code Here

Examples of org.springframework.transaction.annotation.Transactional

    @Produce(uri = "mock:book")
    ProducerTemplate producer;

    @Consume(uri = "seda:book")
    public void handleTitle(String title) {
        Transactional tx = this.getClass().getAnnotation(Transactional.class);
        if (tx == null) {
            throw new IllegalStateException("Spring annotation-driven should have instrumented this class as @Transactional");
        }
        if (!"NEVER".equals(tx.propagation().name())) {
            throw new IllegalStateException("Should be NEVER propagation");
        }
        if (!tx.readOnly()) {
            throw new IllegalStateException("Should be read only");
        }

        if (!title.contains("in Action")) {
            throw new IllegalArgumentException("Not a book title we like");
View Full Code Here

Examples of org.springframework.transaction.annotation.Transactional

    @EndpointInject(uri = "seda:book")
    private ProducerTemplate template;

    public void orderBook(String title) throws Exception {
        Transactional tx = this.getClass().getAnnotation(Transactional.class);
        if (tx == null) {
            throw new IllegalStateException("Spring annotation-driven should have instrumented this class as @Transactional");
        }
        if (!"REQUIRED".equals(tx.propagation().name())) {
            throw new IllegalStateException("Should be REQUIRED propagation");
        }

        if (title.startsWith("Donkey")) {
            throw new IllegalArgumentException("We don't have Donkeys, only Camels");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.