[jboss-user] [Datasource Configuration] - Could not enlist in transaction on entering meta-aware object! (Posgres + SQLite))

Fidox 666 do-not-reply at jboss.com
Mon Aug 23 17:01:57 EDT 2010


Fidox 666 [http://community.jboss.org/people/fidox666] replied to the discussion

"Could not enlist in transaction on entering meta-aware object! (Posgres + SQLite))"

To view the discussion, visit: http://community.jboss.org/message/558644#558644

--------------------------------------------------------------
I think the error was as follows:

1) Data source type "*local-tx-datasource*" does not support multiple data sources (sqlite and postgresql concurrent transactions). The solution here is to change the type of data source from "+*local-tx-datasource*+" to "+*xa-datasource*+"



2) Also sqlite does not support "+*xa-datasource*+" type (specifically the problem with sqlite was that I could not find an sqlite implementation of the class "+*rg.postgresql.xa.PGXADataSource*", (*) maybe you can find one for mysql  :)  ), so I change the second data source database from sqlite to postgresql.
+


This is my "old" data source file:

*+<datasources>+*
*+<!-- Postgresql -->
+*
*+<local-tx-datasource>
+*
*+<jndi-name>Postgres1DS</jndi-name>
+*
*+<connection-url>jdbc:postgresql://localhost:5432/db0</connection-url>
+*
*+<driver-class>org.postgresql.Driver</driver-class>
+*
*+<user-name>user1</user-name>
+*
*+<password>u1pass</password>+*
*+</local-tx-datasource>
+*
*+
+*
*+<!-- SQLite -->
+*
*+<local-tx-datasource>+*
*+<jndi-name>Sqlite1DS</jndi-name>
+*
*+<connection-url>+**+jdbc:sqlite:${jboss.server.data.dir}${/}db1.db+**+</connection-url>+*
*+<driver-class>org.sqlite.JDBC</driver-class>
+*
*+<user-name>user1</user-name>
+*
*+<password>u1pass</password>
+*
*+<connection-property name="autoReconnect">true</connection-property>
+*
*+</local-tx-datasource>+*
*+</datasources>+*


And this is the "new one":


+*<datasources>*+
+*<!-- Postgresql -->
*+
** 
** 
** 
+*   <xa-datasource>*
++*<jndi-name>*+*Postgres1DS*+*</jndi-name>*
+
+
 
*       <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>*
*       <xa-datasource-property name="ServerName">localhost</xa-datasource-property>*
*       <xa-datasource-property name="PortNumber">5432</xa-datasource-property>*
 
*       <xa-datasource-property name="DatabaseName">*+*db0*+*</xa-datasource-property>*
*       <xa-datasource-property name="User">user1</xa-datasource-property>*
*       <xa-datasource-property name="Password">u1pass</xa-datasource-property>*
 
*       <track-connection-by-tx></track-connection-by-tx>*
*    </xa-datasource>*
 
*
*+
+*<!--* +*Postgresql*+ *-->*+
** 
** 
+*    <xa-datasource>
*
*       <jndi-name>Postgres2DS</jndi-name>
*
*       <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
*
** 
+*       <xa-datasource-property name="ServerName">localhost</xa-datasource-property>
*
+*       <xa-datasource-property name="PortNumber">5432</xa-datasource-property>
*
*       <xa-datasource-property name="DatabaseName">db1</xa-datasource-property>
*
*       <xa-datasource-property name="User">user1</xa-datasource-property>
*
*       <xa-datasource-property name="Password">u1pass</xa-datasource-property>
*
*       <track-connection-by-tx></track-connection-by-tx>
*
 *</xa-datasource>
*

+ 

So.. what I suggest you is to change the type of your data sources from "local-tx-datasource" to "xa-datasource", as I say (*).. you must to find a mysql implementation of the class "+xa-datasource-class",
+ and finally if you can not found this class, you should change the mysql database to postgresql.

I hope I have been clear enough, if you find another point of view for this problem please let me know, sorry for my poor english.

Best regards..
 
Fido
 





--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/558644#558644]

Start a new discussion in Datasource Configuration at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2077]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100823/787ce851/attachment-0001.html 


More information about the jboss-user mailing list