Singleton DAO

6 views
Skip to first unread message

Stéphane Claret

unread,
May 10, 2010, 8:48:33 AM5/10/10
to ibaguice
Hello,

I followed the documentation on the website and declared my data
access classes as Singleton.

@Singleton
public class ProductDaoImpl extends AbstractTransactionalDao
implements ProductDao

Sorry if those are stupid questions but

Is it actually suitable to use singleton DAOs in a web application ?
Is it thread safe? (I use pooled data source provider)

Thanks in advance

Marco Speranza

unread,
May 10, 2010, 9:48:28 AM5/10/10
to ibag...@googlegroups.com
Hi Stephan,

yes is possible use @Singleton scope for a DAO and iBaGuice is thread safe.

Cheers 


2010/5/10 Stéphane Claret <stefa...@gmail.com>



--
Marco Speranza <marco.sp...@gmail.com>

Simone Tripodi

unread,
May 10, 2010, 10:16:26 AM5/10/10
to ibag...@googlegroups.com
Salut Stéphan!!!
as Marco said, the iBaGuice provided abstract DAO is thread-safety, so
you can safely define your own DAO and declare it @Singleton.
A bientot!!!
Simo

http://people.apache.org/~simonetripodi/

Stéphane Claret

unread,
May 11, 2010, 4:35:49 AM5/11/10
to ibaguice
Grazie mille Simone and Marco!
I may be back with some questions during the next days, and by the
way, thanks for your great work!

On May 10, 4:16 pm, Simone Tripodi <simone.trip...@gmail.com> wrote:
> Salut Stéphan!!!
> as Marco said, the iBaGuice provided abstract DAO is thread-safety, so
> you can safely define your own DAO and declare it @Singleton.
> A bientot!!!
> Simo
>
> http://people.apache.org/~simonetripodi/
>
> On Mon, May 10, 2010 at 3:48 PM, Marco Speranza
>
> <marco.speranz...@gmail.com> wrote:
> > Hi Stephan,
> > yes is possible use @Singleton scope for a DAO and iBaGuice is thread safe.
> > Cheers
>
> > 2010/5/10 Stéphane Claret <stefatw...@gmail.com>
>
> >> Hello,
>
> >> I followed the documentation on the website and declared my data
> >> access classes as Singleton.
>
> >> @Singleton
> >> public class ProductDaoImpl extends  AbstractTransactionalDao
> >> implements ProductDao
>
> >> Sorry if those are stupid questions but
>
> >> Is it actually suitable to use singleton DAOs in a web application ?
> >> Is it thread safe? (I use pooled data source provider)
>
> >> Thanks in advance
>
> > --
> > Marco Speranza <marco.speranz...@gmail.com>

Simone Tripodi

unread,
May 11, 2010, 5:02:32 AM5/11/10
to ibag...@googlegroups.com
Salut Stéphan,
that's our pleasure, we really hope iBaGuice will be useful for your work :)
Feel free to ask whatever you need, you're welcome!!!
A trés bientot,
Simone

http://people.apache.org/~simonetripodi/
Reply all
Reply to author
Forward
0 new messages