You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by mahens <ma...@gmail.com> on 2011/05/10 12:29:00 UTC

I need JDBC Table definations.

Where can I find the JDBC table definations that I need to create in my
database for JDBC persistence? 





--
View this message in context: http://activemq.2283324.n4.nabble.com/I-need-JDBC-Table-definations-tp3511491p3511491.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: I need JDBC Table definations.

Posted by Gary Tully <ga...@gmail.com>.
they will be created automatically on startup, the sql statements can
be found in the source,
see the getCreateSchemaStatements metod at

http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/Statements.java?view=markup




On 10 May 2011 11:29, mahens <ma...@gmail.com> wrote:
> Where can I find the JDBC table definations that I need to create in my
> database for JDBC persistence?
>
>
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/I-need-JDBC-Table-definations-tp3511491p3511491.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



-- 
http://blog.garytully.com
http://fusesource.com

Re: I need JDBC Table definations.

Posted by Gary Tully <ga...@gmail.com>.
so the sql syntax for the update statement used by the locker is not supported.

So we need a specialisation of the database lock statement also.

Have a look at http://activemq.apache.org/jdbc-support.html where you
can see an example of overriding one of the sql statements.

But more generally we need to add support for the teradata sql dialect.

To see the existing specialisations, peek at the source, you should be
able to make one that works for Terradata.

http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/



On 12 May 2011 05:40, mahens <ma...@gmail.com> wrote:
> http://activemq.2283324.n4.nabble.com/file/n3516486/activemq.log activemq.log
>
> please find i upload log file after enabling debug logging for
> org.apache.activemq.store.jdbc.DefaultDatabaseLocker
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/I-need-JDBC-Table-definations-tp3511491p3516486.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



-- 
http://blog.garytully.com
http://fusesource.com

Re: I need JDBC Table definations.

Posted by mahens <ma...@gmail.com>.
http://activemq.2283324.n4.nabble.com/file/n3516486/activemq.log activemq.log 

please find i upload log file after enabling debug logging for
org.apache.activemq.store.jdbc.DefaultDatabaseLocker 

--
View this message in context: http://activemq.2283324.n4.nabble.com/I-need-JDBC-Table-definations-tp3511491p3516486.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: I need JDBC Table definations.

Posted by Gary Tully <ga...@gmail.com>.
enable debug logging for
org.apache.activemq.store.jdbc.DefaultDatabaseLocker to get a handle
on the root cause exception to see what is going on with the lock
implementation.
That may also need a specialisation.

On 11 May 2011 12:32, mahens <ma...@gmail.com> wrote:
> created the statements manually on my database:
> CREATE TABLE ACTIVEMQ_MSGS
> (ID BIGINT NOT NULL,
>  CONTAINER VARCHAR(250),
>  MSGID_PROD VARCHAR(250),
>  MSGID_SEQ BIGINT,
>  EXPIRATION BIGINT,
>  MSG BYTE,
>  PRIMARY KEY ( ID ) );
>
>  CREATE INDEX ACTIVEMQ_MSGS_MIDX ON ACTIVEMQ_MSGS (MSGID_PROD,MSGID_SEQ);
>
>  CREATE INDEX ACTIVEMQ_MSGS_CIDX ON ACTIVEMQ_MSGS (CONTAINER);
>
>  CREATE INDEX ACTIVEMQ_MSGS_EIDX ON ACTIVEMQ_MSGS (EXPIRATION);
>
>
> still getting same error like:
>
> Using Persistence Adapter:
> JDBCPersistenceAdapter(org.apache.commons.dbcp.BasicDataSource@307b4703)
>  INFO | Database adapter driver override not found for :
> [com_teradata_jdbc_teradriver].  Will use default implementation.
>  INFO | Database lock driver override not found for :
> [com_teradata_jdbc_teradriver].  Will use default implementation.
>  INFO | Attempting to acquire the exclusive lock to become the Master broker
>  INFO | Failed to acquire lock.  Sleeping for 1000 milli(s) before trying
> again...
>  INFO | Failed to acquire lock.  Sleeping for 1000 milli(s) before trying
> again...
>  INFO | Failed to acquire lock.  Sleeping for 1000 milli(s) before trying
> again...
>  INFO | Failed to acquire lock.  Sleeping for 1000 milli(s) before trying
> again...
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/I-need-JDBC-Table-definations-tp3511491p3514432.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



-- 
http://blog.garytully.com
http://fusesource.com

Re: I need JDBC Table definations.

Posted by mahens <ma...@gmail.com>.
created the statements manually on my database:
CREATE TABLE ACTIVEMQ_MSGS
(ID BIGINT NOT NULL,
 CONTAINER VARCHAR(250),
 MSGID_PROD VARCHAR(250),
 MSGID_SEQ BIGINT,
 EXPIRATION BIGINT,
 MSG BYTE,
 PRIMARY KEY ( ID ) );
 
  CREATE INDEX ACTIVEMQ_MSGS_MIDX ON ACTIVEMQ_MSGS (MSGID_PROD,MSGID_SEQ);
  
  CREATE INDEX ACTIVEMQ_MSGS_CIDX ON ACTIVEMQ_MSGS (CONTAINER);
  
  CREATE INDEX ACTIVEMQ_MSGS_EIDX ON ACTIVEMQ_MSGS (EXPIRATION);


still getting same error like:

Using Persistence Adapter:
JDBCPersistenceAdapter(org.apache.commons.dbcp.BasicDataSource@307b4703) 
 INFO | Database adapter driver override not found for :
[com_teradata_jdbc_teradriver].  Will use default implementation. 
 INFO | Database lock driver override not found for :
[com_teradata_jdbc_teradriver].  Will use default implementation. 
 INFO | Attempting to acquire the exclusive lock to become the Master broker 
 INFO | Failed to acquire lock.  Sleeping for 1000 milli(s) before trying
again... 
 INFO | Failed to acquire lock.  Sleeping for 1000 milli(s) before trying
again... 
 INFO | Failed to acquire lock.  Sleeping for 1000 milli(s) before trying
again... 
 INFO | Failed to acquire lock.  Sleeping for 1000 milli(s) before trying
again... 



--
View this message in context: http://activemq.2283324.n4.nabble.com/I-need-JDBC-Table-definations-tp3511491p3514432.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: I need JDBC Table definations.

Posted by Gary Tully <ga...@gmail.com>.
it looks like we need a specialization of the create statements for terajdbc.

On 10 May 2011 12:49, mahens <ma...@gmail.com> wrote:
> Thanks Gary Tully,
>
> as you said it creates tables during startup so i removed tables from
> database.Now i tryed to start the broker but getting error like:
>
>  INFO | Using Persistence Adapter:
> JDBCPersistenceAdapter(org.apache.commons.dbcp.BasicDataSource@34c7e8a7)
>  INFO | Database adapter driver override not found for :
> [com_teradata_jdbc_teradriver].  Will use default implementation.
>  WARN | Could not create JDBC tables; they could already exist. Failure was:
> CREATE INDEX ACTIVEMQ_MSGS_MIDX ON ACTIVEMQ_MSGS (MSGID_PROD,MSGID_SEQ)
> Message: [Teradata Database] [TeraJDBC 13.10.00.18] [Error 3706] [SQLState
> 42000] Syntax error: Must specify index field(s) for CREATE INDEX. SQLState:
> 42000 Vendor code: 3706
>  WARN | Failure details: [Teradata Database] [TeraJDBC 13.10.00.18] [Error
> 3706] [SQLState 42000] Syntax error: Must specify index field(s) for CREATE
> INDEX.
> com.teradata.jdbc.jdbc_4.util.JDBCException: [Teradata Database] [TeraJDBC
> 13.10.00.18] [Error 3706] [SQLState 42000] Syntax error: Must specify index
> field(s) for CREATE INDEX.
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/I-need-JDBC-Table-definations-tp3511491p3511614.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



-- 
http://blog.garytully.com
http://fusesource.com

Re: I need JDBC Table definations.

Posted by mahens <ma...@gmail.com>.
Thanks Gary Tully,

as you said it creates tables during startup so i removed tables from
database.Now i tryed to start the broker but getting error like:

  INFO | Using Persistence Adapter:
JDBCPersistenceAdapter(org.apache.commons.dbcp.BasicDataSource@34c7e8a7)
 INFO | Database adapter driver override not found for :
[com_teradata_jdbc_teradriver].  Will use default implementation.
 WARN | Could not create JDBC tables; they could already exist. Failure was:
CREATE INDEX ACTIVEMQ_MSGS_MIDX ON ACTIVEMQ_MSGS (MSGID_PROD,MSGID_SEQ)
Message: [Teradata Database] [TeraJDBC 13.10.00.18] [Error 3706] [SQLState
42000] Syntax error: Must specify index field(s) for CREATE INDEX. SQLState:
42000 Vendor code: 3706
 WARN | Failure details: [Teradata Database] [TeraJDBC 13.10.00.18] [Error
3706] [SQLState 42000] Syntax error: Must specify index field(s) for CREATE
INDEX.
com.teradata.jdbc.jdbc_4.util.JDBCException: [Teradata Database] [TeraJDBC
13.10.00.18] [Error 3706] [SQLState 42000] Syntax error: Must specify index
field(s) for CREATE INDEX.


--
View this message in context: http://activemq.2283324.n4.nabble.com/I-need-JDBC-Table-definations-tp3511491p3511614.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: I need JDBC Table definations.

Posted by mahens <ma...@gmail.com>.
created table manually with table defination as 
CREATE TABLE ACTIVEMQ_MSGS
(ID BIGINT NOT NULL,
 CONTAINER VARCHAR(250),
 MSGID_PROD VARCHAR(250),
 MSGID_SEQ BIGINT,
 EXPIRATION BIGINT,
 MSG BYTE, PRIMARY KEY ( ID ) );

but still i am getting following error on startup:
 Using Persistence Adapter:
JDBCPersistenceAdapter(org.apache.commons.dbcp.BasicDataSource@307b4703)
 INFO | Database adapter driver override not found for :
[com_teradata_jdbc_teradriver].  Will use default implementation.
 INFO | Database lock driver override not found for :
[com_teradata_jdbc_teradriver].  Will use default implementation.
 INFO | Attempting to acquire the exclusive lock to become the Master broker
 INFO | Failed to acquire lock.  Sleeping for 1000 milli(s) before trying
again...
 INFO | Failed to acquire lock.  Sleeping for 1000 milli(s) before trying
again...
 INFO | Failed to acquire lock.  Sleeping for 1000 milli(s) before trying
again...
 INFO | Failed to acquire lock.  Sleeping for 1000 milli(s) before trying
again...


and i configured only one broker to that database.



--
View this message in context: http://activemq.2283324.n4.nabble.com/I-need-JDBC-Table-definations-tp3511491p3511592.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.