Himanshu shriv

Himanshu shriv

42 Articles Published

Articles by Himanshu shriv

Page 4 of 5

Difference between Object level lock and Class level lock in Java

Himanshu shriv
Himanshu shriv
Updated on 21-Jan-2020 7K+ Views

In multithreading environment, two or more threads can access the shared resources simultaneously which can lead the inconsistent behavior of the system. Java uses concept of locks to restrict concurrent access of shared resources or objects. Locks can be applied at two levels −Object Level Locks − It can be used when you want non-static method or non-static block of the code should be accessed by only one thread.Class Level locks − It can be used when we want to prevent multiple threads to enter the synchronized block in any of all available instances on runtime. It should always be used ...

Read More

Difference between oracle golden gate and oracle active guard in the oracle

Himanshu shriv
Himanshu shriv
Updated on 21-Jan-2020 1K+ Views

Oracle golden gate and oracle active data guard is the data replication technologies. They both are used for data replication but with different strategy. As per the oracle docs −Oracle Active Data Guard provides the best data protection and availability for Oracle Database in the simplest most economical manner by maintaining an exact physical replica of the production copy at a remote location that is open read-only while replication is active. GoldenGate is an advanced logical replication product that supports multi-master replication, hub and spoke deployment and data transformation, providing customers very flexible options to address the complete range of replication requirements. ...

Read More

Difference between logical and physical standby database in the oracle

Himanshu shriv
Himanshu shriv
Updated on 21-Jan-2020 2K+ Views

Logical standby and physical standby database in two different types of standby database. In case of any failure of primary database Oracle transfer data from primary database to the standby database. This approach helps us to recover data from standby database in case of any failure.Logical standby database is not the exact copy of the primary database. Logical standby uses LogMiner techniques to transform the archived redo logs into native DML statements (insert, update, delete).  This DML is transported and applied to the standby database.Primary standby database is the exact copy of primary database so it helps to minimize the ...

Read More

Difference between Inner and Outer join in SQL

Himanshu shriv
Himanshu shriv
Updated on 21-Jan-2020 2K+ Views

In Relational database tables are associated with each other and we used foreign key to maintain relationships between tables. We used join clause to retrieve data from associated tables. The join condition indicates how column in each table are matched against each other. There are two types of joins clause in SQL Inner join Outer joinOuter join is again divided into parts −LEFT OUTER JOIN - It will return all data of the left table and matched  records in both table RIGHT OUTER JOIN - it will return all the data of the right table and matched records in both tableSr. No.KeyInner joinOuter join1Basic It ...

Read More

Difference between ETL and ELT in SQL Server

Himanshu shriv
Himanshu shriv
Updated on 21-Jan-2020 919 Views

ETL stands for Extract, Transform and Load. ETL tool is used to extract data from the source RDBMS database and transform extracted data such as applying business logic and  calculation, etc. and  then load data into the target data warehouse. In ETL tool,  transformation of the data performed at the ETL server. It is used for low amount data.ELT stands for Extract, Load and Transform. ELT tool is also used to extract data from source database and then load data into target database without transformation. In ELT, transformation of data is performed at the target database. In general, in an ...

Read More

Difference between sequence and identity in Hibernate

Himanshu shriv
Himanshu shriv
Updated on 21-Jan-2020 11K+ Views

Hibernate or JPA support 4 different types of  primary key generator. These generators are used to generate primary key while inserting rows in the database. Below are the primary key generator   −GenerationType.AUTOGenerationType. IDENTITYGenerationType.SEQUENCE GenerationType.TABLEGenerationType. IDENTITY − In identity , database is responsible to auto generate the primary key. Insert a row without specifying a value for the ID and after inserting the row, ask the database for the last generated ID.  Oracle 11g does not support identity key generator. This feature is supported in Oracle 12c. GenerationType. SEQUENCE − In sequence, we first ask database for the next set of the sequence ...

Read More

Difference between Collection.stream().forEach() and Collection.forEach() in Java

Himanshu shriv
Himanshu shriv
Updated on 21-Jan-2020 1K+ Views

Collection.stream().forEach() and Collection.forEach() both are used to iterate over collection. Collection.forEach()  uses the collection’s iterator. Most of the collections doesn’t allow the structurally modification while iterating over them. If any element add or remove while iteration they will immediately throw concurrent modification exception. If Collection.forEach() is iterating over the synchronized collection then they will lock the segment of the collection and hold it across all the calls. Collection.stream().forEach() is also used for iterating the collection but it first convert the collection to the stream and then iterate over the stream of the collection therefore the processing order is undefined. It also throws ...

Read More

Difference between readObject and readResolve method in serialization

Himanshu shriv
Himanshu shriv
Updated on 21-Jan-2020 2K+ Views

Serialization is the process of converting object to stream byte and storing byte stream in database or memory. Class which implements java.io.Serializable interface can be serialized. Class which is implementing this interface gives the responsibility to JVM for serialize or persist java object As per the oracle docs −readObject method − Each subclass of a serializable object may define its own readObject method. If a class does not implement the method, the default serialization provided by defaultReadObject will be used. When implemented, the class is only responsible for restoring its own fields, not those of its supertypes or subtypes.The readObject method of ...

Read More

Difference between green and native thread

Himanshu shriv
Himanshu shriv
Updated on 21-Jan-2020 1K+ Views

Green threads are created and scheduled by Virtual machine without using OS libraries. “Green” was the project code name of the thread project which was developed by the Java, therefore the name of the thread is “Green”. It can not make use of multiprocessor.On the other hand, Native threads are created and scheduled by Kernel of operating system. It can swap between threads from running thread to non-running thread. All modern OS supports native thread. Sr. No.KeyGreen ThreadNative Thread1Basic Green threads are created and scheduled by Virtual machine without using OS librariesNative threads are created and scheduled by Kernel of operating system2Platform Dependent It ...

Read More

Difference between save() and persist() in Hibernate

Himanshu shriv
Himanshu shriv
Updated on 21-Jan-2020 23K+ Views

Save() and persist() both methods are used for saving object in the database. As per docs −Save()  − Persist the given transient instance, first assigning a generated identifier. (Or using the current value of the identifier property if the assigned generator is used.) This operation cascades to associated instances if the association is mapped with cascade="save-update".As per docs −persist() −  Make a transient instance persistent. This operation cascades to associated instances if the association is mapped with cascade="persist". The semantics of this method are defined by JSR-220. Sr. No.Keysave()persist()1Basic  It stores object in databaseIt also stores object in database2Return Type It return generated id and return type is ...

Read More
Showing 31–40 of 42 articles
Advertisements