tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <rmannibu...@gmail.com>
Subject Re: web.xml data-source definition
Date Tue, 30 Jan 2018 19:42:25 GMT
See it this way: the server role is to wire the properties he has
(properties and username, password, ...). Now no server will know it for
all possible datasources. Extreme case is you implement your own datasource
and call your username property "login".
In that case, tomee doesnt know about this datasource class and doesnt
forward "username" to "user".


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau>

2018-01-30 20:33 GMT+01:00 gilbertoca <gilbertoca@gmail.com>:

> Romain,
>
> The DataSourceFactory or other class should do this, no?! Because the
> application data source is setup correctly in the web.xml file:
>
> >
> > <data-source>
> >
> > <name>
> > java:app/gaceDS
> > </name>
> >
> > <class-name>
> > org.postgresql.ds.PGSimpleDataSource
> > </class-name>
> >
> > <url>
> > jdbc:postgresql://srv-banco-dev:5433/teste
> > </url>
> >
> > <user>
> > gace_user
> > </user>
> >
> > <password>
> > gace_user
> > </password>
> >
> > <property>
> >
> > <name>
> > ${data-source.property-name}
> > </name>
> >
> > <value>
> > ${data-source.property-valor}
> > </value>
> >
> > </property>
> >
> >
> > <transactional>
> > true
> > </transactional>
> >
> > <isolation-level>
> > TRANSACTION_READ_COMMITTED
> > </isolation-level>
> >
> > <initial-pool-size>
> > 2
> > </initial-pool-size>
> >
> > <max-pool-size>
> > 10
> > </max-pool-size>
> >
> > <min-pool-size>
> > 5
> > </min-pool-size>
> >
> > <max-idle-time>
> > 1800
> > </max-idle-time>
> >
> > <max-statements>
> > 0
> > </max-statements>
> >
> > </data-source>
>
>
>
>
>
> Romain Manni-Bucau wrote
> > if you check the javadoc of your connection you will see that the
> username
> > is set with setUser and not setUsername so you need to set the property
> > "user" instead of using the built-in "username" property.
> >
> >
> > Romain Manni-Bucau
> > @rmannibucau &lt;https://twitter.com/rmannibucau&gt; |  Blog
> > &lt;https://rmannibucau.metawerx.net/&gt; | Old Blog
> > &lt;http://rmannibucau.wordpress.com&gt; | Github
> > &lt;https://github.com/rmannibucau&gt; |
> > LinkedIn &lt;https://www.linkedin.com/in/rmannibucau&gt;
> >
> > 2018-01-30 14:27 GMT+01:00 gilbertoca &lt;
>
> > gilbertoca@
>
> > &gt;:
> >
> >> Romain Manni-Bucau wrote
> >> > Did you set properties properly?
> >>
> >> Yes
> >>
> >> [1]
> >> https://www.dropbox.com/s/4godaf0hu0234b9/web-xml-data-source.png?dl=0
> >> [2]
> >> https://www.dropbox.com/s/rw0ttl950yzxxb7/DataSourceFactory-classname.
> >> png?dl=0
> >> [3]
> >> https://www.dropbox.com/s/nghczwady03ym2v/DataSourceFactory-ds-
> >> properties.png?dl=0
> >>
> >>
> >>
> >>
> >>
> >> --
> >> Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-
> >> f979441.html
> >>
>
>
>
>
>
> --
> Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-
> f979441.html
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message