On Jun 28, 12:46 am, Mark Mandel <[email protected]> wrote:
> To turn that around though.. you could use the
>
> getDatasource().setCurrentThreadDatasource("writeDatasource");
>
> In combination with the Transfer Events to change your datasource details
> transparently.
>
> This would probably provide you with a much more flexible solution, as you
> could start changing all sorts of details depending on what event you are
> running.
>
> Just trying to think of something that will serve if people had, I dunno,
> something weird, like 4 different DBs or something ;o)
>

I just don't see this being useful because it's so much work. You'd
write the app, realize you needed to scale, and then have to go back
and rewrite all your code to handle the datasource changes. And it's
not just that one line, it's try catches and lots of architecture
decisions.

Your solution still doesn't prevent those cases where some action
causes a lazy load or a proxy load to hit the writing datasource
either. That's especially dangerous if you change it inside Transfer
events, and so is the fact that you could leave your thread with the
wrong one. For instance before save might change it, but then if there
was a database failure after save would never fire, and you'd never
change it back.

before save could also fire and kick off actions that again cause more
read hits to the writing database.

There'd be no transparency because you'd need to be very careful of
what methods you call because any indirection in the same thread might
cause one of those loads on the wrong datasource.

This needs to be handled inside Transfer.
--~--~---------~--~----~------------~-------~--~----~
Before posting questions to the group please read:
http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer

You received this message because you are subscribed to the Google Groups 
"transfer-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/transfer-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to