camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmuel...@apache.org
Subject svn commit: r1228959 - /camel/branches/camel-2.9.x/components/camel-sql/src/main/java/org/apache/camel/processor/idempotent/jdbc/JdbcMessageIdRepository.java
Date Sun, 08 Jan 2012 21:22:59 GMT
Author: cmueller
Date: Sun Jan  8 21:22:58 2012
New Revision: 1228959

URL: http://svn.apache.org/viewvc?rev=1228959&view=rev
Log:
CAMEL-4152: jdbc idempotent repository - table creation

Modified:
    camel/branches/camel-2.9.x/components/camel-sql/src/main/java/org/apache/camel/processor/idempotent/jdbc/JdbcMessageIdRepository.java

Modified: camel/branches/camel-2.9.x/components/camel-sql/src/main/java/org/apache/camel/processor/idempotent/jdbc/JdbcMessageIdRepository.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-sql/src/main/java/org/apache/camel/processor/idempotent/jdbc/JdbcMessageIdRepository.java?rev=1228959&r1=1228958&r2=1228959&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-sql/src/main/java/org/apache/camel/processor/idempotent/jdbc/JdbcMessageIdRepository.java
(original)
+++ camel/branches/camel-2.9.x/components/camel-sql/src/main/java/org/apache/camel/processor/idempotent/jdbc/JdbcMessageIdRepository.java
Sun Jan  8 21:22:58 2012
@@ -62,13 +62,19 @@ public class JdbcMessageIdRepository ext
                 try {
                     // we will receive an exception if the table doesn't exists or we cannot
access it
                     jdbcTemplate.execute(tableExistsString);
-                    log.debug("table for JdbcMessageIdRepository already exists");
+                    log.debug("Expected table for JdbcMessageIdRepository exist");
                 } catch (DataAccessException e) {
                     if (createTableIfNotExists) {
-                        log.debug("creating table for JdbcMessageIdRepository because it
doesn't exists...");
-                        // we will fail if we cannot create it
-                        jdbcTemplate.execute(createString);
-                        log.info("table created with query '{}'", createString);
+                        try {
+                            log.debug("creating table for JdbcMessageIdRepository because
it doesn't exist...");
+                            jdbcTemplate.execute(createString);
+                            log.info("table created with query '{}'", createString);
+                        } catch (DataAccessException dae) {
+                            // we will fail if we cannot create it
+                            log.error("Can't create table for JdbcMessageIdRepository with
query '{}' because of: {}. This may be a permissions problem. Please create this table and
try again.",
+                                    createString, e.getMessage());
+                            throw dae;
+                        }
                     } else {
                         throw e;
                     }



Mime
View raw message