Posts by Flávio Granato • 1,170 points
21 posts
-
1
votes1
answer39
viewsQ: Exceptions and database connection
I have a code that query a database. If a timeout exception occurs for example during the execution of the query, the connection closure code and consequent return of the connection to the pool will…
-
2
votes1
answer249
viewsA: What is the best location to provide a property file?
No default path to place from application.yml. Your question seems to me more on how to improve the security of access to the server that runs the application than on how to hide the user and…
-
5
votes1
answer1414
viewsQ: REST API versioning. Is there a way to do it and what would be the best option?
Currently I develop integration Apis with services internal to our company and in the near future we will have the opportunity to provide some of our Apis to external partners. Suggest the idea of…
-
5
votes3
answers747
viewsA: Working with ID limit on large volumes
I indicate the use of UUID since it is unique. We usually sort the data by other columns and not by id. To know who comes before who is ordered by the date of creation only if it has and if…
-
1
votes1
answer919
viewsQ: How to limit heap size in a JVM 8?
Until jvm 7 the -Xmx parameter limited the heap size, but today in jvm 8 this is not happening. Today I use the -Xmx200m parameter and my application even consumes 1.5GB in heap, I use a lot of…
-
5
votes1
answer608
viewsQ: JVM. What is the difference between Metaspace and permgen?
What is the difference between Metaspace and permgen? I’ve been trying for a while to understand, I could help?
-
2
votes1
answer271
viewsQ: JVM instrumentation. Know how many times a method was called during program execution
I have a processing application for batch, currently she is multithreads, I need to know how many times we are running the save method. Would anyone have any idea? Because I need to increase the…
-
10
votes1
answer164
viewsA: Good Practices (Refactoring) - Best way to treat one method with for within another
The question of a for within another creates a cyclomatic complexity very high. More in kids, a large mental load to be able to understand what the method should do. You can use some techniques…
-
1
votes4
answers11166
viewsA: Recover a file in GIT
You can use these commands: git rev-list -n 1 HEAD -- <file_path> Where -n X is the amount of previous commits that the file exists. git checkout <deleting_commit>^ -- <file_path>…
gitanswered Flávio Granato 1,170 -
4
votes2
answers768
viewsA: Git repository size problem
You can make a Cherry-pick and remove or undo a patch. Here has a good explanation about the Cherry-pick and here has an answered question that closely resembles your problem. I suggest very calm at…
gitanswered Flávio Granato 1,170 -
0
votes3
answers603
viewsA: Multithread in web application
This need has a lot of "Actors" like Erlang, clojure, scala or Akka (now scala standard but with java implementation as well). There are other competing models too, you can go to apache Storm, have…
-
3
votes3
answers8960
viewsA: When is it interesting to denormalize the database?
There is. It is at a very specific time that is the creation of datamarts for BI. It’s what they call star schema versus Snowflake schema. I’ll give my star schema view because Snowflake is wrong in…
-
1
votes2
answers2530
viewsA: Maven - Configuring the Mainclass
Your main class should be declared this way: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId>…
-
-1
votes8
answers7818
viewsA: Check if variable contains a well formatted PHP email address
I would bet on regular experiences. Because RFC5322 is younger than RFC822 then I would try an expression that validates it, like this one:…
-
1
votes3
answers1689
viewsA: How to read file passing part of the name in Java
Use an expression next to this. This expression allows something like 20140512_0000_xxxxxxx.xml.gz being yyyymmdd_hhmm_client.xml.gz Pass this expression to the getFilter() then use the…
-
11
votes3
answers740
viewsA: Is sending data to the same form a good method?
Another way around this and also ensure a little more security is to use a Submit token. Example: When someone asks for the login screen you create a token, example a uuid saves and sends in Hide in…
-
8
votes7
answers14277
viewsA: What can C++ do that C# can’t?
Direct access to memory address. Even if extended with C++ the VM does not allow you to directly access memory addresses. Write Hardware Drivers
-
8
votes6
answers14419
viewsA: Which database should I use in a small desktop application?
The important thing is the physical access to the database, because in my view both Sqlserver and Mysql are safe from a network access point of view. It depends on the confidentiality requirement of…
-
9
votes3
answers949
viewsQ: Scrypt, Bcrypt or anything else
I’m choosing a hash algorithm for passwords from a system I develop. At the beginning of my "programmatic" I used the MD5, the SHA-1 and its derivantes. After a while I preferred the Whirlpool and…
-
0
votes5
answers2656
viewsA: How to manage a Sqlite connection between multiple simultaneous threads?
Start with the default "who opens the connection is who closes it", I’m sorry I don’t know if there is a cool name for this pattern... :-) Implementing the Datasource interface helps you define how…
-
1
votes3
answers370
viewsA: How to perform TDD using Hibernate
I think you’re going down the road of testing the technology and not the business domain of your problem. I think you could try to "mock" the Hibernate with a mockite for example and not worry so…