@@muralikrishnasijuThreadLocal works just fine with virtual threads too. Only thing is it should not be used as a caching solution for expensive to create objects, as every virtual thread and as they are not pooled, also every task, would end up creating their own thread local instance. Maybe ScopedValue would work here? I am not sure, haven’t played around with them yet.
Hi, What should be the right approach for this scenario: Having an application that is tenantcy based with different database for each tenant to manage its data, let say we have more than 1k of tenants meaning 1k different databases, how efficient would be to switch between them if we determine the tenant by the request received, the typical example is to identify the tenant using a request HEADER. Thanks for your comments.
Hi Josh, thank you for sharing your knowledge. May I suggest an improvement? In the metaprogramming part, the use of the HikariDataSource instead of LazyConnectionDataSourceProxy would be more explicit in order to show the lack of call of the getConnection method. Replace: if (bean instanceof LazyConnectionDataSourceProxy db) { with: if (bean instanceof HikariDataSource db) { then you get: class com.zaxxer.hikari.HikariDataSource.getConnection() class com.zaxxer.hikari.pool.HikariProxyConnection operation: apac no operation: The no operation part exhibits no call to the getConnection() method anymore. Please note that I added the class of the invoked bean in the message.
No audio on right channel.
Very cool, informative, reasonably deep dived and educational video. Thank you for your efforts Josh, keep it up!
Great talk! Very informative and touches on some key areas which can be confusing for beginners.
Big thanks to your very educational videos. Please note that this add a huge help for easy and fun learning. Keep it up 😊
That was very useful, thank you Josh and many thanks to all Spring developers ❤
Waiting 😊
I was looking ages for a "quick" guidance on this topic!
Hey the sound is mono 😀
How will ThreadLocal work with Virtual Threads for AbstractRoutingDataSource?
Did you find any solution?
@@muralikrishnasijuThreadLocal works just fine with virtual threads too. Only thing is it should not be used as a caching solution for expensive to create objects, as every virtual thread and as they are not pooled, also every task, would end up creating their own thread local instance. Maybe ScopedValue would work here? I am not sure, haven’t played around with them yet.
Could you please provide link to GitHub repo of this project
cool
hi.. will it be possible for you to add Scala to SpringBoot
Hi, What should be the right approach for this scenario:
Having an application that is tenantcy based with different database for each tenant to manage its data, let say we have more than 1k of tenants meaning 1k different databases, how efficient would be to switch between them if we determine the tenant by the request received, the typical example is to identify the tenant using a request HEADER.
Thanks for your comments.
Do u know how to connect to multiple dbs if the db url we will get only in runtime?I can't find a way
My left ear agrees, but my right ear is not so sure.
thanks for this, I actually thought that my earphones were the issue🤣
Hi Josh, thank you for sharing your knowledge. May I suggest an improvement?
In the metaprogramming part, the use of the HikariDataSource instead of LazyConnectionDataSourceProxy would be more explicit in order to show the lack of call of the getConnection method.
Replace:
if (bean instanceof LazyConnectionDataSourceProxy db) {
with:
if (bean instanceof HikariDataSource db) {
then you get:
class com.zaxxer.hikari.HikariDataSource.getConnection()
class com.zaxxer.hikari.pool.HikariProxyConnection
operation: apac
no operation:
The no operation part exhibits no call to the getConnection() method anymore.
Please note that I added the class of the invoked bean in the message.
What IDE are you using
It's IntelliJ Idea Ultimate
@@thinhdz-0 Thank you
It started easy and got too advanced pretty fast
There is no sound !!
Not useful for understanding. Too fast and no structure in how to acheiver the goal